summaryrefslogtreecommitdiffstats
path: root/conf/solaris/smf/svc-puppetd
blob: 5fbcfe796e7e50c8a8dcdb5e93ad92eb59c9a3c5 (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
63
64
65
66
#!/bin/sh
# This is the /etc/init.d file for puppetd
# Modified for CSW
#
# description: puppetd - Puppet Automation Client
#

. /lib/svc/share/smf_include.sh

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

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

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

    printf "Starting Puppet client services:"

    /opt/csw/bin/puppetd

    printf " puppetd"
    echo ""
    ;;
stop)
    printf "Stopping Puppet client services:"
    kill `cat $pidfile`

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

    printf " puppetd"
    echo ""
    ;;
reload)
    printf "Reloading Puppet client services:"

    kill -HUP `cat $pidfile`

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

# $Id$