Mon, Feb 04, 2013 at 05:53:16PM CET, jtluka(a)redhat.com wrote:
Hello everyone,
since some of the testing we do is targeted at RHEL releases that does not
have systemd I've created an initscript that seems to work with the current
RHEL6 release. See it attached.
Looks good to me.
Radek, should I put it under dist directory? If so, I'll post a patch.
Yes, put it there.
Plan to include lnst packages into epel?
Any comments welcome!
-Jan
#!/bin/bash
#
# lnst Starts up the LNST slave daemon
#
# chkconfig: - 20 80
# description: LNST is a framework to automate network configuration and
# testing. This service starts up the LNST slave daemon.
#
# processname: lnst
# pidfile: /var/run/lnst-slave.pid
### BEGIN INIT INFO
# Provides: lnst
# Required-Start: $local_fs $network
# Required-Stop: $local_fs
# Short-Description: Starts up the LNST slave daemon
# Description: LNST is a framework to automate network configuration and
# testing. This service starts up the LNST slave daemon.
### END INIT INFO
# source function library
. /etc/rc.d/init.d/functions
RETVAL=0
prog="lnst-slave"
lockfile=/var/lock/subsys/$prog
# Some functions to make the below more readable
LNST=/usr/bin/lnst-slave
PID_FILE=/var/run/lnst-slave.pid
OPTIONS="--daemonize"
start()
{
[ -x $LNST ] || exit 5
echo -n $"Starting $prog: "
$LNST $OPTIONS && success || failure
RETVAL=$?
[ $RETVAL -eq 0 ] && touch $lockfile
echo
return $RETVAL
}
stop()
{
echo -n $"Stopping $prog: "
killproc lnst-slave
RETVAL=$?
[ $RETVAL -eq 0 ] && rm -f $lockfile
echo
}
reload() {
restart
}
restart() {
stop
start
}
force_reload() {
restart
}
rh_status() {
status lnst-slave
}
rh_status_q() {
rh_status >/dev/null 2>&1
}
case "$1" in
start)
rh_status_q && exit 0
$1
;;
stop)
rh_status_q || exit 0
$1
;;
restart)
$1
;;
reload)
rh_status_q || exit 7
$1
;;
force-reload)
$1
;;
condrestart|try-restart)
rh_status_q || exit 0
restart
;;
status)
rh_status
;;
*)
echo $"Usage: $0
{start|stop|restart|reload|force-reload|condrestart|try-restart|status}"
RETVAL=2
esac
exit $RETVAL
_______________________________________________
LNST-developers mailing list
LNST-developers(a)lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/lnst-developers