summaryrefslogtreecommitdiffstats
path: root/conf/solaris/smf/svc-puppetmasterd
blob: e1a8d85bcb57a8885952675ec70909521d404eb8 (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/sh
#

. /lib/svc/share/smf_include.sh

prefix=/opt/csw
exec_prefix=/opt/csw
sysconfdir=/opt/csw/etc
sbindir=/opt/csw/sbin

pidfile=/var/puppet/run/puppetmasterd.pid

case "$1" in
start)
    cd /
    # Start daemons.

    printf "Starting Puppet server services:"

    /opt/csw/bin/puppetmasterd

    printf " puppetmaster"
    echo ""
    ;;
stop)
    printf "Stopping Puppet server services:"
    kill `cat $pidfile`

    printf " puppetmasterd"
    echo ""
    ;;
restart)
    printf "Restarting Puppet server services:"
    kill -HUP `cat $pidfile`

    printf " puppetmasterd"
    echo ""
    ;;
reload)
    printf "Reloading Puppet server services:"

    kill -HUP `cat $pidfile`

	printf " puppetmasterd"
	echo ""
    ;;
status)
    if [ -f $pidfile ]; then
        pid=`cat $pidfile`
        curpid=`pgrep puppetmasterd`
        if [ "$pid" -eq "$curpid" ]; then
            exit 0
        else
            exit 1
        fi
    else
        exit 1
    fi
esac
exit 0

# $Id$