summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiels de Vos <ndevos@redhat.com>2013-05-07 11:10:26 +0200
committerAnand Avati <avati@redhat.com>2013-05-07 11:48:25 -0700
commitf00720f3ed760f018d8c847476563a5eb1b111a3 (patch)
tree8299f5cb297ec1d75f55c6f4efca66c4452f2250
parentcce370f6d2c1d3bfaf1d772ebe5d6a01f761016f (diff)
extras: /etc/init.d/glusterd should create a lockfile under /var/lock/sybsys
Without a lockfile under /var/lock/subsys, the glusterd service is not stopped on shutdown or reboot. Change-Id: Ib2c28821061ed0fd374731681a81f3fd8e989193 BUG: 960476 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/4961 Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
-rwxr-xr-xextras/init.d/glusterd-Redhat.in6
1 files changed, 6 insertions, 0 deletions
diff --git a/extras/init.d/glusterd-Redhat.in b/extras/init.d/glusterd-Redhat.in
index e1e5e85..7db7e1b 100755
--- a/extras/init.d/glusterd-Redhat.in
+++ b/extras/init.d/glusterd-Redhat.in
@@ -47,6 +47,8 @@ GLUSTERD_OPTS="--pid-file=$PIDFILE ${GLUSTERD_OPTIONS}"
GLUSTERD="$GLUSTERD_BIN $GLUSTERD_OPTS"
RETVAL=0
+LOCKFILE=/var/lock/subsys/${BASE}
+
# Start the service $BASE
start()
{
@@ -59,6 +61,7 @@ start()
daemon $GLUSTERD
RETVAL=$?
echo
+ [ $RETVAL -eq 0 ] && touch $LOCKFILE
return $RETVAL
fi
}
@@ -73,6 +76,9 @@ stop()
else
killproc $BASE
fi
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && rm -f $LOCKFILE
+ return $RETVAL
}
restart()