aboutsummaryrefslogtreecommitdiff
path: root/app/admin/puppet/rc.puppet.new
blob: d9738c0d4f8b18e09ba0916411025649f44b154e (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
#!/bin/sh

puppet_start() {
	echo "Starting puppet"
	start-stop-daemon --start --quiet \
		--pidfile "/var/run/puppetd.pid" \
		--exec /usr/bin/puppetd
  if [ "$?" != "0" ]; then
    echo "Failed to start puppet"
  fi
}

puppet_stop() {
  echo "Stopping puppet"
  start-stop-daemon --stop --quiet \
    --pidfile "/var/run/puppet/puppetd.pid"
  if [ "$?" != "0" ]; then
    echo "Failed to stop puppet"
  fi
  rm -f "/var/run/puppet/puppetd.pid"
}

case "$1" in
'start')
  puppet_start
  ;;
'stop')
  puppet_stop
  ;;
'restart')
  puppet_stop
  puppet_start
  ;;
*)
  echo "usage $0 start|stop|restart"
esac