Monotone-Parent: 6140aebb346323f84af35a4ebdf8250e6532d39e

Monotone-Revision: 107bfcafb94e725ae14c9e2bceacbf8399ae6958

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2009-12-14T16:02:15
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2009-12-14 16:02:15 +00:00
parent c51ba5b099
commit 7fd62cf7c4
2 changed files with 5 additions and 29 deletions

View File

@@ -97,27 +97,14 @@ start() {
stop() {
echo $"Stopping $DESC: "
# We kill the parent processes with SIGTERM so that they
# can exit gracefully.
pid="`cat $PIDFILE 2> /dev/null`"
if [ -n "$pid" ]
then
pid="`ps --pid ${pid} -o pid=`"
if [ -n "$pid" ]
then
if kill $pid >& /dev/null
then
sleep 1
pid="`ps --pid ${pid} -o pid=`"
if [ -n "$pid" ]
then
kill $pid >& /dev/null
echo " $NAME stopped"
else
kill -9 $pid >& /dev/null
echo " $NAME killed"
fi
rm -f $PIDFILE
fi
else
echo " $NAME not running"
fi
@@ -131,20 +118,9 @@ restart() {
pid="`cat $PIDFILE 2> /dev/null`"
if [ -n "$pid" ]
then
pid="`ps --pid ${pid} -o pid=`"
if [ -n "$pid" ]
then
if kill $pid >& /dev/null
then
kill $pid >& /dev/null
fi
sleep 1
pid="`ps --pid ${pid} -o pid=`"
if [ -n "$pid" ]
then
kill -9 $pid >& /dev/null
fi
fi
fi
fi
daemon --user="$USER" --pidfile="$PIDFILE" "$DAEMON" $DAEMON_OPTS
echo " $NAME"
}