summaryrefslogtreecommitdiffstats
path: root/network/policyd/rc.policyd
diff options
context:
space:
mode:
author Nishant Limbachia2010-05-11 20:01:41 +0200
committer Robby Workman2010-05-11 20:01:41 +0200
commit77ec8dfec3015dd14ab7b0d8e4b54f08f388ee25 (patch)
tree8bec40468f179793e3676d7a7b992e83775fda4f /network/policyd/rc.policyd
parent8c7dd59abf863eeff9d397e73303e707486ba18c (diff)
downloadslackbuilds-77ec8dfec3015dd14ab7b0d8e4b54f08f388ee25.tar.gz
network/policyd: Added to 12.0 repository
Diffstat (limited to 'network/policyd/rc.policyd')
-rw-r--r--network/policyd/rc.policyd45
1 files changed, 45 insertions, 0 deletions
diff --git a/network/policyd/rc.policyd b/network/policyd/rc.policyd
new file mode 100644
index 0000000000..a6400e71c9
--- /dev/null
+++ b/network/policyd/rc.policyd
@@ -0,0 +1,45 @@
+#!/bin/sh
+#
+# /etc/rc.d/rc.policyd
+#
+# start/stop/restart policy daemon
+
+# 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.
+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
+ fi
+}
+
+policyd_stop() {
+ echo "Stopping Policy daemon"
+ /bin/kill $(cat $PIDFILE)
+ rm -f $PIDFILE
+}
+
+policyd_restart() {
+ policyd_stop
+ sleep 2
+ policyd_start
+}
+
+case "$1" in
+'start')
+ policyd_start
+ ;;
+'stop')
+ policyd_stop
+ ;;
+'restart')
+ policyd_restart
+ ;;
+'*')
+ echo "USAGE: $0 start|stop|restart"
+ exit 1
+ ;;
+esac