Lines 13-21
Link Here
|
13 |
# Set it to the full path to the config file |
13 |
# Set it to the full path to the config file |
14 |
# that stunnel will use during the automated |
14 |
# that stunnel will use during the automated |
15 |
# start-up. |
15 |
# start-up. |
16 |
# stunnel_pidfile (str): Default "%%PREFIX%%/var/stunnel/stunnel.pid" |
16 |
# stunnel_pidfile (str): Default "%%STUNNEL_PIDFILE%%" |
17 |
# Set it to the value of 'pid' in |
17 |
# Set it to the value of 'pid' in |
18 |
# the stunnel.conf file. |
18 |
# the stunnel.conf file. |
|
|
19 |
# stunnel_uid (str): Default "%%STUNNEL_USER%%" |
20 |
# stunnel_gid (str): Default "%%STUNNEL_GROUP%%" |
19 |
# |
21 |
# |
20 |
|
22 |
|
21 |
. /etc/rc.subr |
23 |
. /etc/rc.subr |
Lines 27-33
load_rc_config $name
Link Here
|
27 |
|
29 |
|
28 |
: ${stunnel_enable="NO"} |
30 |
: ${stunnel_enable="NO"} |
29 |
: ${stunnel_config="%%ETCDIR%%/${name}.conf"} |
31 |
: ${stunnel_config="%%ETCDIR%%/${name}.conf"} |
30 |
: ${stunnel_pidfile="/var/run/${name}.pid"} |
32 |
: ${stunnel_pidfile="%%STUNNEL_PIDFILE%%"} |
|
|
33 |
: ${stunnel_uid="%%STUNNEL_USER%%"} |
34 |
: ${stunnel_gid="%%STUNNEL_GROUP%%"} |
31 |
|
35 |
|
32 |
command="%%PREFIX%%/bin/stunnel" |
36 |
command="%%PREFIX%%/bin/stunnel" |
33 |
command_args=${stunnel_config} |
37 |
command_args=${stunnel_config} |
Lines 35-38
pidfile=${stunnel_pidfile}
Link Here
|
35 |
|
39 |
|
36 |
required_files="${stunnel_config}" |
40 |
required_files="${stunnel_config}" |
37 |
|
41 |
|
|
|
42 |
start_precmd=stunnel_start_precmd |
43 |
|
44 |
stunnel_start_precmd () { |
45 |
local piddir |
46 |
piddir=`/usr/bin/dirname "${pidfile}"` |
47 |
if [ ! -d "${piddir}" ] ; then |
48 |
/usr/bin/install -d -o "${stunnel_uid}" -g "${stunnel_gid}" "${piddir}" |
49 |
fi |
50 |
} |
51 |
|
38 |
run_rc_command "$1" |
52 |
run_rc_command "$1" |