summaryrefslogtreecommitdiff
path: root/system/cfengine/rc.cfenvd
diff options
context:
space:
mode:
Diffstat (limited to 'system/cfengine/rc.cfenvd')
-rw-r--r--system/cfengine/rc.cfenvd45
1 files changed, 45 insertions, 0 deletions
diff --git a/system/cfengine/rc.cfenvd b/system/cfengine/rc.cfenvd
new file mode 100644
index 0000000000..03bf800b9c
--- /dev/null
+++ b/system/cfengine/rc.cfenvd
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+# start/stop/restart/reload cfenvd
+
+# Start cfenvd:
+cfenvd_start() {
+ if [ -x /usr/sbin/cfenvd ]; then
+ echo "Starting the CFEengine environment service: /usr/sbin/cfexecd"
+ /usr/sbin/cfenvd
+ fi
+}
+
+# Stop cfenvd:
+cfenvd_stop() {
+ /bin/killall cfenvd 2> /dev/null
+}
+
+# Restart cfenvd:
+cfenvd_restart() {
+ cfenvd_stop
+ sleep 1
+ cfenvd_start
+}
+
+# Reload cfenvd:
+cfenvd_reload() {
+ /bin/killall -HUP cfenvd
+}
+
+case "$1" in
+'start')
+ cfenvd_start
+ ;;
+'stop')
+ cfenvd_stop
+ ;;
+'restart')
+ cfenvd_restart
+ ;;
+'reload')
+ cfenvd_reload
+ ;;
+*)
+ echo "usage $0 start|stop|restart|reload"
+esac