Lines 18-23
Link Here
|
18 |
# influxd_group (str): influxd daemon group |
18 |
# influxd_group (str): influxd daemon group |
19 |
# Default: influxd |
19 |
# Default: influxd |
20 |
# influxd_flags (str): Extra flags passed to influxd |
20 |
# influxd_flags (str): Extra flags passed to influxd |
|
|
21 |
# |
22 |
# influxd_facility (str): Syslog facility to use |
23 |
# Default: daemon |
24 |
# influxd_priority (str): Syslog priority to use |
25 |
# Default: info |
21 |
|
26 |
|
22 |
. /etc/rc.subr |
27 |
. /etc/rc.subr |
23 |
|
28 |
|
Lines 29-43
Link Here
|
29 |
: ${influxd_user:="%%INFLUXD_USER%%"} |
34 |
: ${influxd_user:="%%INFLUXD_USER%%"} |
30 |
: ${influxd_group:="%%INFLUXD_GROUP%%"} |
35 |
: ${influxd_group:="%%INFLUXD_GROUP%%"} |
31 |
: ${influxd_flags:=""} |
36 |
: ${influxd_flags:=""} |
|
|
37 |
: ${influxd_facility:="daemon"} |
38 |
: ${influxd_priority:="info"} |
32 |
: ${influxd_conf:="%%PREFIX%%/etc/${name}.conf"} |
39 |
: ${influxd_conf:="%%PREFIX%%/etc/${name}.conf"} |
33 |
: ${influxd_options:="${influxdb_flags} -config=${influxd_conf} 2> %%INFLUXD_LOGDIR%%/influxdb.log"} |
40 |
: ${influxd_options:="${influxdb_flags} -config=${influxd_conf}"} |
34 |
|
41 |
|
35 |
# daemon |
42 |
# daemon |
36 |
influxd_pidfile="%%INFLUXD_PIDDIR%%${name}.pid" |
43 |
influxd_pidfile="%%INFLUXD_PIDDIR%%${name}.pid" |
37 |
procname="%%PREFIX%%/bin/${name}" |
44 |
procname="%%PREFIX%%/bin/${name}" |
38 |
command=/usr/sbin/daemon |
45 |
command=/usr/sbin/daemon |
39 |
command_args="-c -p ${influxd_pidfile} ${procname} ${influxd_options}" |
|
|
40 |
start_precmd="influxd_precmd" |
46 |
start_precmd="influxd_precmd" |
|
|
47 |
start_cmd="influxd_startcmd_%%INFLUXD_LOGCMD%%" |
41 |
|
48 |
|
42 |
influxd_precmd() |
49 |
influxd_precmd() |
43 |
{ |
50 |
{ |
Lines 44-47
Link Here
|
44 |
install -d -o ${influxd_user} %%INFLUXD_PIDDIR%% |
51 |
install -d -o ${influxd_user} %%INFLUXD_PIDDIR%% |
45 |
} |
52 |
} |
46 |
|
53 |
|
|
|
54 |
influxd_startcmd_daemon() |
55 |
{ |
56 |
echo "Starting ${name}." |
57 |
/usr/sbin/daemon -c -p ${influxd_pidfile} -S -s ${influxd_priority} -l ${influxd_facility} \ |
58 |
-u ${influxd_user} ${procname} ${influxd_options} |
59 |
} |
60 |
|
61 |
influxd_startcmd_logger() |
62 |
{ |
63 |
echo "Starting ${name}." |
64 |
/usr/sbin/daemon -c -p ${influxd_pidfile} -u ${influxd_user} /bin/sh -c "${procname} ${influxd_options} 2>&1 \ |
65 |
| /usr/bin/logger -t ${name} -p ${influxd_facility}.${influxd_priority}" |
66 |
} |
67 |
|
47 |
run_rc_command "$1" |
68 |
run_rc_command "$1" |