summaryrefslogtreecommitdiff
path: root/extra/cyrus-sasl/saslauthd
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2011-08-07 23:14:33 +0000
committerroot <root@rshg054.dnsready.net>2011-08-07 23:14:33 +0000
commit0f9e4ba23bb6296d8bb8010f70d868fd08db9c54 (patch)
treeddd4394d1c62e9831f05238ff56a70da01f6c5c0 /extra/cyrus-sasl/saslauthd
parent7f2d7bd11daf0c654d4147cb91f9913bc587c276 (diff)
Sun Aug 7 23:14:33 UTC 2011
Diffstat (limited to 'extra/cyrus-sasl/saslauthd')
-rw-r--r--extra/cyrus-sasl/saslauthd21
1 files changed, 10 insertions, 11 deletions
diff --git a/extra/cyrus-sasl/saslauthd b/extra/cyrus-sasl/saslauthd
index c470c801c..6afafae0b 100644
--- a/extra/cyrus-sasl/saslauthd
+++ b/extra/cyrus-sasl/saslauthd
@@ -8,33 +8,32 @@
DAEMON_NAME="saslauthd"
SASLAUTHD_BIN=/usr/sbin/saslauthd
-SASLAUTHD_PID=`pidof -o %PPID $SASLAUTHD_BIN`
+SASLAUTHD_RUN=/var/run/saslauthd
+SASLAUTHD_PID=$SASLAUTHD_RUN/saslauthd.pid
case "$1" in
start)
stat_busy "Starting $DAEMON_NAME"
- [ -z "$SASLAUTHD_PID" ] && $SASLAUTHD_BIN $SASLAUTHD_OPTS
- if [ $? -gt 0 ]; then
+ [ ! -d /var/run/saslauthd ] && install -d /var/run/saslauthd
+ if $SASLAUTHD_BIN $SASLAUTHD_OPTS >/dev/null; then
+ add_daemon $DAEMON_NAME
+ stat_done
+ else
stat_fail
exit 1
- else
- echo `pidof -o %PPID $SASLAUTHD_BIN` > /var/run/$DAEMON_NAME.pid
fi
- add_daemon $DAEMON_NAME
- stat_done
;;
stop)
stat_busy "Stopping $DAEMON_NAME"
- [ ! -z "$SASLAUTHD_PID" ] && kill $SASLAUTHD_PID &> /dev/null
+ [ -f $SASLAUTHD_PID ] && kill `cat $SASLAUTHD_PID` &>/dev/null
if [ $? -gt 0 ]; then
stat_fail
exit 1
else
- rm /var/run/$DAEMON_NAME.pid &> /dev/null
+ rm_daemon $DAEMON_NAME
+ stat_done
fi
- rm_daemon $DAEMON_NAME
- stat_done
;;
restart)