4 # description: The puppet agent connects to a puppet master, requests a
5 # catalog of resources, and configures the local system.
8 # Get function from functions library
9 . /etc/init.d/functions
11 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
12 DAEMON=/usr/bin/puppet
13 DAEMON_OPTS="agent --server master --no-daemonize"
16 PIDFILE="/var/run/${NAME}.pid"
17 PID=`test -f $PIDFILE && cat $PIDFILE`
20 test -x $DAEMON || exit 0
22 [ -r /etc/default/puppet ] && . /etc/default/puppet
24 reload_puppet_agent() {
25 start-stop-daemon --stop --quiet --signal HUP --pidfile $PIDFILE
28 start_puppet_agent() {
29 start-stop-daemon --start --quiet --pidfile $PIDFILE \
30 --startas $DAEMON -- $NAME $DAEMON_OPTS
34 start-stop-daemon --stop --retry TERM/10/KILL/5 --quiet --oknodo --pidfile $PIDFILE
37 status_puppet_agent() {
38 status_of_proc -p "${PIDFILE}" "${DAEMON}" "${NAME}"
43 echo -n "Starting $DESC"
48 echo -n "Stopping $DESC"
53 echo -n "Reloading $DESC"
61 echo -n "Restarting $DESC"
67 echo "Usage: $0 {start|stop|status|restart|force-reload|reload}" >&2