Lines 14-20
Link Here
|
14 |
# Set it to YES to enable h2o. |
14 |
# Set it to YES to enable h2o. |
15 |
# |
15 |
# |
16 |
# h2o_config (string): Optional full path for h2o config file |
16 |
# h2o_config (string): Optional full path for h2o config file |
17 |
# h2o_user (user): Set to h2o by default. |
|
|
18 |
|
17 |
|
19 |
. /etc/rc.subr |
18 |
. /etc/rc.subr |
20 |
|
19 |
|
Lines 23-44
Link Here
|
23 |
|
22 |
|
24 |
# defaults |
23 |
# defaults |
25 |
: ${h2o_enable:="NO"} |
24 |
: ${h2o_enable:="NO"} |
26 |
: ${h2o_user:="%%H2O_USER%%"} |
|
|
27 |
: ${h2o_config:="%%PREFIX%%/etc/${name}/${name}.conf"} |
25 |
: ${h2o_config:="%%PREFIX%%/etc/${name}/${name}.conf"} |
28 |
: ${h2o_options:=" --conf ${h2o_config}"} |
|
|
29 |
|
26 |
|
30 |
# daemon |
27 |
# daemon |
31 |
h2o_pidfile="%%H2O_PIDDIR%%${name}.pid" |
28 |
pidfile=`grep pid-file ${h2o_config} | cut -d' ' -f2` |
32 |
procname="%%PREFIX%%/bin/${name}" |
29 |
command="%%PREFIX%%/bin/${name}" |
33 |
command=/usr/sbin/daemon |
30 |
command_args="-m daemon -c ${h2o_config}" |
34 |
command_args=" -f -c -p ${h2o_pidfile} ${procname} ${h2o_options}" |
31 |
procname="perl" |
35 |
start_precmd="h2o_precmd" |
|
|
36 |
|
32 |
|
37 |
h2o_precmd() |
|
|
38 |
{ |
39 |
# create empty pidfile with correct permissions |
40 |
install -o ${h2o_user} /dev/null ${h2o_pidfile} |
41 |
} |
42 |
|
43 |
load_rc_config $name |
33 |
load_rc_config $name |
44 |
run_rc_command "$1" |
34 |
run_rc_command "$1" |