summaryrefslogtreecommitdiff
path: root/system/cfengine/rc.cfengine
diff options
context:
space:
mode:
authorMenno Duursma <druiloor@zonnet.nl>2010-05-11 15:18:34 +0200
committerRobby Workman <rworkman@slackbuilds.org>2010-05-11 15:18:34 +0200
commit5c160af0fa05ff3b602b4f6db3fc67f1431f9ab4 (patch)
tree5b121c5ef09bcffce7f011c171493bb4431d5153 /system/cfengine/rc.cfengine
parent62b4c461d93a90c64db1e492bbe0679c4e60b950 (diff)
downloadslackbuilds-5c160af0fa05ff3b602b4f6db3fc67f1431f9ab4.tar.gz
system/cfengine: Initial import
Diffstat (limited to 'system/cfengine/rc.cfengine')
-rw-r--r--system/cfengine/rc.cfengine51
1 files changed, 51 insertions, 0 deletions
diff --git a/system/cfengine/rc.cfengine b/system/cfengine/rc.cfengine
new file mode 100644
index 0000000000..a58103c72a
--- /dev/null
+++ b/system/cfengine/rc.cfengine
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+# Start cfengine:
+cfengine_start() {
+ if [ -x /usr/sbin/cfexecd ]; then
+ # Make sure localhost keys exist first
+ if [ ! -f /var/cfengine/ppkeys/localhost.priv ]; then
+ /usr/sbin/cfkey
+ fi
+ echo "Starting Cfengine: /usr/sbin/cfexecd"
+ /usr/sbin/cfexecd
+ fi
+}
+
+# Stop cfengine:
+cfengine_stop() {
+ /bin/killall cfenvd 2> /dev/null
+ /bin/killall cfexecd 2> /dev/null
+ /bin/killall cfservd 2> /dev/null
+}
+
+# Restart cfengine:
+cfengine_restart() {
+ cfengine_stop
+ sleep 1
+ cfengine_start
+}
+
+# Reload cfengine:
+cfengine_reload() {
+ /bin/killall -HUP cfenvd
+ /bin/killall -HUP cfexecd
+ /bin/killall -HUP cfservd
+}
+
+case "$1" in
+'start')
+ cfengine_start
+ ;;
+'stop')
+ cfengine_stop
+ ;;
+'restart')
+ cfengine_restart
+ ;;
+'reload')
+ cfengine_reload
+ ;;
+*)
+ echo "usage $0 start|stop|restart|reload"
+esac