Changeset View
Changeset View
Standalone View
Standalone View
databases/influxdb/files/influxd.in
Show All 37 Lines | |||||
: ${influxd_conf:="%%PREFIX%%/etc/${name}.conf"} | : ${influxd_conf:="%%PREFIX%%/etc/${name}.conf"} | ||||
: ${influxd_options:="${influxd_flags} -config=${influxd_conf}"} | : ${influxd_options:="${influxd_flags} -config=${influxd_conf}"} | ||||
# daemon | # daemon | ||||
influxd_pidfile="%%INFLUXD_PIDDIR%%${name}.pid" | influxd_pidfile="%%INFLUXD_PIDDIR%%${name}.pid" | ||||
procname="%%PREFIX%%/bin/${name}" | procname="%%PREFIX%%/bin/${name}" | ||||
command=/usr/sbin/daemon | command=/usr/sbin/daemon | ||||
start_precmd="influxd_precmd" | start_precmd="influxd_precmd" | ||||
start_cmd="influxd_startcmd_%%INFLUXD_LOGCMD%%" | start_cmd="influxd_startcmd_%%INFLUXD_LOGCMD%%" | ||||
influxd_precmd() | influxd_precmd() | ||||
{ | { | ||||
install -d -o ${influxd_user} %%INFLUXD_PIDDIR%% | install -d -o ${influxd_user} %%INFLUXD_PIDDIR%% | ||||
} | } | ||||
influxd_startcmd_daemon() | influxd_startcmd_daemon() | ||||
{ | { | ||||
echo "Starting ${name}." | echo "Starting ${name}." | ||||
/usr/sbin/daemon -c -p ${influxd_pidfile} -S -s ${influxd_priority} -l ${influxd_facility} \ | /usr/sbin/daemon -c -p ${influxd_pidfile} -S -s ${influxd_priority} -l ${influxd_facility} -T ${name} \ | ||||
-u ${influxd_user} ${procname} ${influxd_options} | -u ${influxd_user} ${procname} ${influxd_options} | ||||
} | } | ||||
influxd_startcmd_logger() | influxd_startcmd_logger() | ||||
{ | { | ||||
echo "Starting ${name}." | echo "Starting ${name}." | ||||
/usr/sbin/daemon -c -p ${influxd_pidfile} -u ${influxd_user} /bin/sh -c "${procname} ${influxd_options} 2>&1 \ | /usr/sbin/daemon -c -p ${influxd_pidfile} -u ${influxd_user} /bin/sh -c "${procname} ${influxd_options} 2>&1 \ | ||||
| /usr/bin/logger -t ${name} -p ${influxd_facility}.${influxd_priority}" | | /usr/bin/logger -t ${name} -p ${influxd_facility}.${influxd_priority}" | ||||
} | } | ||||
run_rc_command "$1" | run_rc_command "$1" |