aboutsummaryrefslogtreecommitdiff
path: root/sysutils/py-salt/files/salt_minion.in
blob: e25a0ecc660d7804b0e07634b0c0c3ecc9d875c6 (plain) (blame)
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
#!/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_pidfile:=/var/run/salt-minion.pid}
: ${salt_minion_eggcache=/tmp}

command="%%PREFIX%%/bin/salt-minion"
command_interpreter="%%PYTHON_CMD%%"
required_files="%%PREFIX%%/etc/salt"
command_args="-c ${required_files} -d"
pidfile=${salt_minion_pidfile}

export PATH="${salt_minion_paths}"
export PYTHON_EGG_CACHE="${salt_minion_eggcache}"

run_rc_command "$1"