When py-processtitle is installed, the master and minion daemons will change their process titles in a way that breaks commands like "service salt_minion status". status, stop, restart, etc are all broken. Fix this bug by: * Always installing py-processtitle unconditionally, * Fixing utils/process.py to not insert an extra space in the title * Adjusting the RC scripts accordingly A downside is that many service subcommands will now print this harmless warning message: ``` /usr/local/etc/rc.d/salt_minion: WARNING: cannot read shebang line from MultiMinionProcessManager ``` Approved by: krion (maintainer) Sponsored by: ConnectWise PR: 285053
43 lines
1.2 KiB
Bash
43 lines
1.2 KiB
Bash
#!/bin/sh
|
|
|
|
# Salt Minion startup script
|
|
#
|
|
# PROVIDE: salt_minion
|
|
# REQUIRE: LOGIN
|
|
# KEYWORD: shutdown
|
|
|
|
# Add the following to /etc/rc.conf[.local] to enable this service
|
|
#
|
|
# salt_minion_enable (bool): Set to NO by default.
|
|
# Set it to YES to enable salt_minion
|
|
# salt_minion_paths (string): Set to "/sbin:/bin:/usr/sbin:/usr/bin:%%PREFIX%%/bin:%%PREFIX%%/sbin" by default.
|
|
# Default $PATH for salt_minion
|
|
# salt_minion_eggcache (string): Set to "/tmp" by default.
|
|
# Allows defining egg cache directory to fix runtime on diskless systems.
|
|
#
|
|
|
|
. /etc/rc.subr
|
|
|
|
name=salt_minion
|
|
rcvar=salt_minion_enable
|
|
|
|
load_rc_config ${name}
|
|
|
|
: ${salt_minion_enable:=NO}
|
|
: ${salt_minion_paths=/sbin:/bin:/usr/sbin:/usr/bin:%%PREFIX%%/bin:%%PREFIX%%/sbin}
|
|
: ${salt_minion_configdir:=%%PREFIX%%/etc/salt}
|
|
: ${salt_minion_pidfile:=/var/run/salt-minion.pid}
|
|
: ${salt_minion_eggcache=/tmp}
|
|
|
|
command="%%PREFIX%%/bin/salt-minion"
|
|
command_interpreter="%%PYTHON_CMD%%"
|
|
required_files=${salt_minion_configdir}
|
|
pidfile=${salt_minion_pidfile}
|
|
command_args="-c ${required_files} --pid-file=${pidfile} -d"
|
|
procname="MultiMinionProcessManager"
|
|
|
|
export PATH="${salt_minion_paths}"
|
|
export PYTHON_EGG_CACHE="${salt_minion_eggcache}"
|
|
|
|
run_rc_command "$1"
|