File: svc-puppetd

package info (click to toggle)
puppet 5.5.22-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 21,316 kB
  • sloc: ruby: 254,925; sh: 1,608; xml: 219; makefile: 153; sql: 103
file content (71 lines) | stat: -rwxr-xr-x 1,189 bytes parent folder | download | duplicates (2)
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
67
68
69
70
71
#!/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/sbin

if [ -z $SMF_SYSVOL_FS ]; then 
  piddir=/var/run/puppetlabs
else
  piddir=$SMF_SYSVOL_FS/puppetlabs
fi;

pidfile=$piddir/agent.pid

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

    printf "Starting Puppet client services:"
    mkdir -p $piddir

    /opt/csw/sbin/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