diff options
author | root <root@rshg054.dnsready.net> | 2012-02-18 23:15:35 +0000 |
---|---|---|
committer | root <root@rshg054.dnsready.net> | 2012-02-18 23:15:35 +0000 |
commit | 1098e9db0acc5bb5c45af5778492faf3b4c99dd6 (patch) | |
tree | 24f65718bdb292fc62194464db8bee1348c48ee5 /community-testing/courier-authlib/authdaemond.rc.d | |
parent | b31146f2405c7d0f50bcc36b682af46be84cdeb8 (diff) |
Sat Feb 18 23:15:35 UTC 2012
Diffstat (limited to 'community-testing/courier-authlib/authdaemond.rc.d')
-rw-r--r-- | community-testing/courier-authlib/authdaemond.rc.d | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/community-testing/courier-authlib/authdaemond.rc.d b/community-testing/courier-authlib/authdaemond.rc.d new file mode 100644 index 000000000..791c3d122 --- /dev/null +++ b/community-testing/courier-authlib/authdaemond.rc.d @@ -0,0 +1,53 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions + +start() { + [ -d /var/run/authdaemon ] || mkdir -p /var/run/authdaemon + chown courier:courier /var/run/authdaemon + + stat_busy "Starting Authdaemond" + /usr/sbin/authdaemond start &> /dev/null + if [ $? -gt 0 ]; then + stat_fail + else + add_daemon authdaemond + stat_done + fi +} + +stop() { + stat_busy "Stopping Authdaemond" + /usr/sbin/authdaemond stop &> /dev/null + if [ $? -gt 0 ]; then + stat_fail + else + rm -f /var/run/authdaemon/{pid.lock,pid,socket} &> /dev/null + + # TODO: Take these out at some point, they're only cleanup for old way + rm -f /var/run/authdaemond.pid &> /dev/null + rm -f /var/spool/authdaemon/{pid.lock,pid,socket} &> /dev/null + + rm_daemon authdaemond + stat_done + fi +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + # calling 'stop' and 'start' without the $0 fails... + $0 stop + sleep 2 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac +exit 0 |