mirror of
https://git.freebsd.org/ports.git
synced 2025-06-29 16:40:31 -04:00
literal name_enable wherever possible, and ${name}_enable when it's not, to prepare for the demise of set_rcvar(). In cases where I had to hand-edit unusual instances also modify formatting slightly to be more uniform (and in some cases, correct). This includes adding some $FreeBSD$ tags, and most importantly moving rcvar= to right after name= so it's clear that one is derived from the other.
56 lines
1.2 KiB
Bash
56 lines
1.2 KiB
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
|
|
# PROVIDE: puppetmaster
|
|
# REQUIRE: NETWORK
|
|
|
|
# Add the following lines to /etc/rc.conf to enable the puppetmaster:
|
|
#
|
|
# puppetmaster_enable="YES"
|
|
#
|
|
|
|
. /etc/rc.subr
|
|
|
|
name="puppetmaster"
|
|
rcvar=puppetmaster_enable
|
|
|
|
load_rc_config "${name}"
|
|
|
|
: ${puppetmaster_enable="NO"}
|
|
: ${puppetmaster_rundir="%%PUPPET_RUNDIR%%"}
|
|
: ${puppetmaster_flags="--rundir=${puppetmaster_rundir}"}
|
|
|
|
command_interpreter="%%PREFIX%%/bin/ruby18"
|
|
command="%%PREFIX%%/bin/puppet"
|
|
command_args="master ${puppetmaster_flags}"
|
|
unset puppetmaster_flags
|
|
|
|
pidfile="${puppetmaster_rundir}/master.pid"
|
|
puppet_manifestdir="$($command config print manifestdir)"
|
|
|
|
start_precmd="puppetmaster_checkconfig"
|
|
restart_precmd="puppetmaster_checkconfig"
|
|
puppetmaster_checkconfig() {
|
|
echo -n "Performing sanity check of ${name} configuration: "
|
|
if ! ${command} parser validate "${puppet_manifestdir}/site.pp"
|
|
then
|
|
echo "FAILED"
|
|
return 1
|
|
else
|
|
echo "OK"
|
|
return 0
|
|
fi
|
|
}
|
|
|
|
if [ -z "${puppetmaster_mongrel_ports}" ]; then
|
|
run_rc_command "$1"
|
|
else
|
|
for port in ${puppetmaster_mongrel_ports}; do
|
|
pidfile="${puppetmaster_rundir}/mongrel.${port}.pid"
|
|
command_args="master --pidfile=${pidfile} --servertype=mongrel --masterport=${port}"
|
|
run_rc_command "$1"
|
|
_rc_restart_done="false"
|
|
done
|
|
fi
|