[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Freeipmi-devel] [PATCH 8/9] Rename lockfiles
From: |
Jan Safranek |
Subject: |
[Freeipmi-devel] [PATCH 8/9] Rename lockfiles |
Date: |
Wed, 23 Sep 2009 12:46:49 +0200 |
User-agent: |
StGIT/0.14.3 |
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 <address@hidden>
---
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] [PATCH 0/9] Unsorted init script tuning, Jan Safranek, 2009/09/23
- [Freeipmi-devel] [PATCH 1/9] Initscript should return '5' when 'program is not installed', Jan Safranek, 2009/09/23
- [Freeipmi-devel] [PATCH 2/9] Return '6' if there is no config file, Jan Safranek, 2009/09/23
- [Freeipmi-devel] [PATCH 3/9] Add sample configuration file for ipmidetectd, Jan Safranek, 2009/09/23
- [Freeipmi-devel] [PATCH 4/9] Don't start running service, Jan Safranek, 2009/09/23
- [Freeipmi-devel] [PATCH 5/9] Reload operation is not supported by the daemons, Jan Safranek, 2009/09/23
- [Freeipmi-devel] [PATCH 6/9] Add missing actions, Jan Safranek, 2009/09/23
- [Freeipmi-devel] [PATCH 7/9] Return proper exit code, Jan Safranek, 2009/09/23
- [Freeipmi-devel] [PATCH 8/9] Rename lockfiles,
Jan Safranek <=
- [Freeipmi-devel] [PATCH 9/9] Remove freeipmi- prefix from initscript, Jan Safranek, 2009/09/23
- Re: [Freeipmi-devel] [PATCH 0/9] Unsorted init script tuning, Al Chu, 2009/09/23