ports/sysutils/py-salt/files/salt_master.in
Brad Davis 7472c5e220 sysutils/py-salt: Teach the Salt master and minion startup scripts to set
pidfile=.

On a restart this will cause the rc framework to wait for the processes to
exit before trying to start, instead of failing to start because the previous
processes have not gone away yet.

PR:		217154
Approved by:	Christer Edwards <christer.edwards@gmail.com> (maintainer),
		bdrewery (mentor, implicit)
2017-02-17 15:59:58 +00:00

42 lines
1.2 KiB
Bash

#!/bin/sh
# $FreeBSD$
#
# Salt Master startup script
#
# PROVIDE: salt_master
# REQUIRE: LOGIN
# KEYWORD: shutdown
# Add the following to /etc/rc.conf[.local] to enable this service
#
# salt_master_enable (bool): Set to NO by default.
# Set it to YES to enable salt_master.
# salt_master_paths (string): Set to "/sbin:/bin:/usr/sbin:/usr/bin:%%PREFIX%%/bin:%%PREFIX%%/sbin" by default.
# Default $PATH for salt_master.
# salt_master_eggcache (string): Set to "/tmp" by default.
# Allows defining egg cache directory to fix runtime on diskless systems.
#
. /etc/rc.subr
name=salt_master
rcvar=salt_master_enable
load_rc_config ${name}
: ${salt_master_enable:=NO}
: ${salt_master_paths=/sbin:/bin:/usr/sbin:/usr/bin:%%PREFIX%%/bin:%%PREFIX%%/sbin}
: ${salt_master_pidfile:=/var/run/salt-master.pid}
: ${salt_master_eggcache=/tmp}
command="%%PREFIX%%/bin/salt-master"
command_interpreter="%%PYTHON_CMD%%"
required_files="%%PREFIX%%/etc/salt"
command_args="-c ${required_files} -d"
pidfile=${salt_master_pidfile}
export PATH="${salt_master_paths}"
export PYTHON_EGG_CACHE="${salt_master_eggcache}"
run_rc_command "$1"