From 6870e49f821e46ba9a49b7daaceb0bf34b1be97b Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Mon, 30 Aug 2010 19:38:56 +0000 Subject: [PATCH] sogo-init.d-redhat is now LSB-compliant. Monotone-Parent: 15292db4f31efc55098659a1e0d5c4fb1d4042c0 Monotone-Revision: c5f3c68d5e922909b6e807bee4d63d2f4218a2c6 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2010-08-30T19:38:56 Monotone-Branch: ca.inverse.sogo --- Scripts/sogo-init.d-redhat | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Scripts/sogo-init.d-redhat b/Scripts/sogo-init.d-redhat index e54a3f1dd..925de539f 100755 --- a/Scripts/sogo-init.d-redhat +++ b/Scripts/sogo-init.d-redhat @@ -75,6 +75,8 @@ fi DAEMON_OPTS="-WOWorkersCount $PREFORK -WOPidFile $PIDFILE -WOLogFile $LOGFILE" +RETVAL=0 + start() { echo $"Starting $DESC: " pid="`cat $PIDFILE 2> /dev/null`" @@ -84,15 +86,19 @@ start() { if [ -n "$pid" ] then echo " $NAME already running. Skipped." + RETVAL=0 else rm -f $PIDFILE daemon --user="$USER" --pidfile="$PIDFILE" "$DAEMON" $DAEMON_OPTS + RETVAL=$? echo " $NAME (stale pid file removed)" fi else daemon --user="$USER" --pidfile="$PIDFILE" "$DAEMON" $DAEMON_OPTS + RETVAL=$? echo " $NAME" fi + return $RETVAL } stop() { @@ -104,13 +110,17 @@ stop() { if [ -n "$pid" ] then kill $pid >& /dev/null + RETVAL=$? echo " $NAME stopped" else echo " $NAME not running" + RETVAL=0 fi else echo " $NAME not running" + RETVAL=0 fi + return $RETVAL } restart() { @@ -145,4 +155,4 @@ case "$1" in ;; esac -exit 0 +exit $?