diff options
author | Nishant Limbachia <nishant@mnspace.net> | 2010-05-12 17:44:08 +0200 |
---|---|---|
committer | Robby Workman <rworkman@slackbuilds.org> | 2010-05-12 17:44:08 +0200 |
commit | 8497f2d5d4766f694473ce4ee57a5bb47a14f542 (patch) | |
tree | 311d939750611a2cc6df34f41c2cc325725e2b81 /network/policyd/rc.policyd | |
parent | 40562dc9577c9028898cb54e0d65f36c7dd340a3 (diff) | |
download | slackbuilds-8497f2d5d4766f694473ce4ee57a5bb47a14f542.tar.gz |
network/policyd: Updated for version 1.82
Diffstat (limited to 'network/policyd/rc.policyd')
-rw-r--r-- | network/policyd/rc.policyd | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/network/policyd/rc.policyd b/network/policyd/rc.policyd index a6400e71c9..06f87a21e8 100644 --- a/network/policyd/rc.policyd +++ b/network/policyd/rc.policyd @@ -2,24 +2,40 @@ # # /etc/rc.d/rc.policyd # -# start/stop/restart policy daemon - +# start/stop/restart Policy daemon for Postfix +# # The PIDFILE is setup in the config file. Default is /var/run/policyd.pid -# if you change the location in the config file then it **needs** to be changed here too. +# If you change the location in the config file then it **needs** to be +# changed here too. + PIDFILE="/var/run/policyd.pid" CONFIG="/etc/policyd.conf" policyd_start() { if [ -x /etc/rc.d/rc.policyd ]; then - echo "Starting Policy daemon" - /usr/bin/policyd -c $CONFIG + if [ -f $PIDFILE ]; then + echo "Policy daemon seems to be running with PID: $(cat $PIDFILE)" + else + if [ -r "$CONFIG" ]; then + echo "Starting Policy daemon" + /usr/bin/policyd -c $CONFIG + else + echo "$CONFIG is missing or unreadable. Exiting..." + exit 1 + fi + fi fi } policyd_stop() { - echo "Stopping Policy daemon" - /bin/kill $(cat $PIDFILE) - rm -f $PIDFILE + if [ -f $PIDFILE ]; then + echo "Stopping Policy daemon" + /bin/kill $(cat $PIDFILE) + rm -f $PIDFILE + else + echo "Policy daemon is not running..." + exit 1 + fi } policyd_restart() { @@ -38,8 +54,9 @@ case "$1" in 'restart') policyd_restart ;; -'*') +*) echo "USAGE: $0 start|stop|restart" exit 1 ;; esac + |