updated on Thu Jan 19 20:01:47 UTC 2012
[aur-mirror.git] / puppet-git / puppet
blob4126be850583b784a8fd842057b6edd1c837409d
1 #!/bin/bash
2 DAEMON=$(type -p puppetd)
4 . /etc/rc.conf
5 . /etc/rc.d/functions
6 [ -f /etc/conf.d/puppet ] && . /etc/conf.d/puppet
8 PID=$(pidof -xo %PPID $DAEMON)
9 case "$1" in
10 start)
11 stat_busy "Starting Puppet Daemon"
12 if [ -z "$PID" ]; then
13 [ -f /var/run/puppet.pid ] && rm -f /var/run/puppet.pid
14 $DAEMON $PUPPETD_ARGS
16 if [ ! -z "$PID" -o $? -gt 0 ]; then
17 stat_fail
18 else
19 PID=$(pidof -xo %PPID $DAEMON)
20 echo $PID > /var/run/puppet.pid
21 add_daemon puppet
22 stat_done
25 stop)
26 stat_busy "Stopping Puppet Daemon"
27 [ ! -z "$PID" ] && kill $PID &> /dev/null
28 if [ $? -gt 0 ]; then
29 stat_fail
30 else
31 rm_daemon puppet
32 rm -f /var/run/puppet.pid
33 stat_done
36 restart)
37 $0 stop
38 if [ ! -z $PID ]; then
39 while ps -p $PID > /dev/null; do sleep 1; done
41 $0 start
44 echo "usage: $0 {start|stop|restart}"
45 esac