summaryrefslogtreecommitdiffstats
path: root/wrappers
diff options
context:
space:
mode:
authorNathan Kinder <nkinder@redhat.com>2009-02-17 23:21:05 +0000
committerNathan Kinder <nkinder@redhat.com>2009-02-17 23:21:05 +0000
commitbfe0c19a8495abeade5a6aaec7901d66d2489021 (patch)
tree2b5d9cee003b4bfe4bcd65e72f2f6ccb37c1ae40 /wrappers
parent086de1d73e8b702a42f0816ff34c49a274dccda9 (diff)
downloadds-bfe0c19a8495abeade5a6aaec7901d66d2489021.tar.gz
ds-bfe0c19a8495abeade5a6aaec7901d66d2489021.tar.xz
ds-bfe0c19a8495abeade5a6aaec7901d66d2489021.zip
Resolves: 245894
Summary: Make init script verify that existing pidfile refers to a ns-slapd process.
Diffstat (limited to 'wrappers')
-rw-r--r--wrappers/initscript.in9
1 files changed, 7 insertions, 2 deletions
diff --git a/wrappers/initscript.in b/wrappers/initscript.in
index d32c1ab1..9f4676fe 100644
--- a/wrappers/initscript.in
+++ b/wrappers/initscript.in
@@ -138,7 +138,10 @@ start() {
server_running=0
if [ -f $pidfile ]; then
pid=`cat $pidfile`
- if kill -0 $pid > /dev/null 2>&1 ; then
+ instlockfile="@localstatedir@/lock/@package_name@/slapd-$instance/server/$pid"
+ if kill -0 $pid && \
+ [ $(awk '{print $2}' /proc/$pid/stat) = "(ns-slapd)" ] \
+ > /dev/null 2>&1 ; then
echo_n " already running"
success; echo
successes=`expr $successes + 1`
@@ -146,7 +149,9 @@ start() {
else
echo " not running, but pid file exists"
echo_n " $instance... attempting to start anyway"
- rm -f $pidfile
+ # Clean up the instance lockfile since we know the pid. The
+ # pidfiles will get cleaned up below.
+ rm -f $instlockfile
fi
fi
server_started=0