summaryrefslogtreecommitdiff
path: root/system/cfengine/rc.cfenvd
blob: 03bf800b9c653467ba3aa53653527acafe957115 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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