File: puppetmaster.init

package info (click to toggle)
puppet 0.20.1-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 3,072 kB
  • ctags: 3,365
  • sloc: ruby: 47,009; sh: 496; lisp: 143; xml: 122; makefile: 67
file content (51 lines) | stat: -rw-r--r-- 1,010 bytes parent folder | download
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
46
47
48
49
50
51
#! /bin/sh

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/puppetmasterd
DAEMON_OPTS=""
NAME=puppetmasterd
DESC="puppet configuration management tool master server"

test -x $DAEMON || exit 0

[ -r /etc/default/puppetmaster ] && . /etc/default/puppetmaster

. /lib/lsb/init-functions

start_puppetmaster() {
	start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
		--exec $DAEMON -- $DAEMON_OPTS
}

stop_puppetmaster() {
	start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid
}

case "$1" in
    start)
	log_begin_msg "Starting $DESC"
	start_puppetmaster
	log_end_msg $?
	;;
    stop)
	log_begin_msg "Stopping $DESC"
	stop_puppetmaster
	log_end_msg $?
	;;
  reload)
  	# Do nothing, as Puppetmaster rechecks its config automatically
        ;;
  restart|force-reload)
	log_begin_msg "Restarting $DESC"
	stop_puppetmaster
	sleep 1
	start_puppetmaster
	log_end_msg 0
	;;
  *)
	echo "Usage: $0 {start|stop|restart|force-reload}" >&2
	exit 1
	;;
esac

exit 0