45 lines
1.1 KiB
Bash
45 lines
1.1 KiB
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
# PROVIDE: puppetmasterd
|
|
# REQUIRE: NETWORK
|
|
|
|
# Add the following lines to /etc/rc.conf to enable puppetmasterd:
|
|
#
|
|
# puppetmasterd_enable="YES"
|
|
# puppetmasterd_confdir: Set to %%PREFIX%%/etc/puppet by default
|
|
# puppetmasterd_flags: Set to --confdir $puppetmasterd_confdir --rundir /var/run" by default
|
|
#
|
|
|
|
. %%RC_SUBR%%
|
|
|
|
name="puppetmasterd"
|
|
rcvar=`set_rcvar`
|
|
|
|
command="%%PREFIX%%/bin/${name}"
|
|
command_interpreter="%%PREFIX%%/bin/ruby18"
|
|
start_precmd="puppetmasterd_checkconfig"
|
|
restart_precmd="puppetmasterd_checkconfig"
|
|
|
|
puppetmasterd_checkconfig() {
|
|
echo -n "Performing sanity check of ${name} configuration: "
|
|
${command} --parseonly ${puppetmasterd_flags} >/dev/null 2>&1
|
|
rv=$?
|
|
if [ $rv != 0 ]; then
|
|
echo "FAILED, ${name} exited with status ${rv}"
|
|
${command} --parseonly ${puppetmasterd_flags}
|
|
return 1
|
|
else
|
|
echo "OK"
|
|
fi
|
|
}
|
|
|
|
load_rc_config "$name"
|
|
: ${puppetmasterd_enable="NO"}
|
|
: ${puppetmasterd_confdir="%%PREFIX%%/etc/puppet"}
|
|
: ${puppetmasterd_pid="/var/run/${name}.pid"}
|
|
: ${puppetmasterd_flags="--confdir $puppetmasterd_confdir --rundir /var/run"}
|
|
pidfile="$puppetmasterd_pid"
|
|
|
|
run_rc_command "$1"
|