status() function from /etc/init.d/functions expects that the binary name (/usr/bin/ipmidetectd) and lock file (/var/lock/subsys/freeipmi-ipmidetectd) have the same file name. Otherwise the function returns wrong exit codes, which leads to wrong exit code of the whole initscript.
Signed-off-by: Jan Safranek <[email protected]> --- bmc-watchdog/freeipmi-bmc-watchdog.init | 2 +- ipmidetect/freeipmi-ipmidetectd.init | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/bmc-watchdog/freeipmi-bmc-watchdog.init b/bmc-watchdog/freeipmi-bmc-watchdog.init index 217de89..b49416c 100755 --- a/bmc-watchdog/freeipmi-bmc-watchdog.init +++ b/bmc-watchdog/freeipmi-bmc-watchdog.init @@ -14,7 +14,7 @@ DAEMON=/usr/sbin/bmc-watchdog PIDFILE=/var/run/freeipmi-bmc-watchdog.pid -LOCKFILE=/var/lock/subsys/freeipmi-bmc-watchdog +LOCKFILE=/var/lock/subsys/bmc-watchdog CONFFILE=/etc/sysconfig/freeipmi-bmc-watchdog [ -f $DAEMON ] || exit 5 diff --git a/ipmidetect/freeipmi-ipmidetectd.init b/ipmidetect/freeipmi-ipmidetectd.init index f099c92..e5521b4 100644 --- a/ipmidetect/freeipmi-ipmidetectd.init +++ b/ipmidetect/freeipmi-ipmidetectd.init @@ -15,6 +15,7 @@ IPMIDETECTD=/usr/sbin/ipmidetectd IPMIDETECTD_CONF=/etc/ipmidetectd.conf +LOCKFILE=//var/lock/subsys/ipmidetectd [ -f $IPMIDETECTD ] || exit 5 [ -f $IPMIDETECTD_CONF ] || exit 6 @@ -26,13 +27,13 @@ if [ -f /etc/rc.d/init.d/functions ] ; then daemon $IPMIDETECTD RETVAL=$? echo - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/freeipmi-ipmidetectd + [ $RETVAL -eq 0 ] && touch $LOCKFILE } Xstop() { killproc ipmidetectd -TERM RETVAL=$? echo - [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/freeipmi-ipmidetectd + [ $RETVAL -eq 0 ] && rm -f $LOCKFILE } Xstatus() { status ipmidetectd @@ -40,7 +41,7 @@ if [ -f /etc/rc.d/init.d/functions ] ; then return $RETVAL } Xcondrestart() { - if test -e /var/lock/subsys/freeipmi-ipmidetectd; then + if test -e $LOCKFILE; then $0 stop $0 start RETVAL=$? _______________________________________________ Freeipmi-devel mailing list [email protected] http://lists.gnu.org/mailman/listinfo/freeipmi-devel
