summaryrefslogtreecommitdiff
path: root/sysutils/puppet6/files/puppet.in
blob: fbdfef003ed54674e5fa24122550f32ced86d390 (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
#!/bin/sh

# PROVIDE: puppet
# REQUIRE: LOGIN
# KEYWORD: shutdown

#
# Add the following lines to /etc/rc.conf to enable the puppet agent:
#
# puppet_enable="YES"

. /etc/rc.subr

name="puppet"
rcvar=puppet_enable

load_rc_config "$name"

: ${puppet_enable="NO"}
: ${puppet_rundir="/var/run/puppet"}

command="%%PREFIX%%/bin/puppet"
command_args="agent ${puppet_flags} --rundir=${puppet_rundir}"
command_interpreter=%%RUBY%%
unset puppet_flags

pidfile="${puppet_rundir}/agent.pid"
start_precmd="install -d -o puppet -g puppet ${pidfile%/*}"

PATH="${PATH}:%%PREFIX%%/bin:%%PREFIX%%/sbin"

# An UTF-8 locale is required
: LC_ALL=${LC_ALL:=C.UTF-8}
case $LC_ALL in
    *.UTF-8)
	;;
    *.*)
	LC_ALL="${LC_ALL%.*}.UTF-8"
	;;
    *)
	LC_ALL=C.UTF-8
	;;
esac
export LC_ALL

run_rc_command "$1"