2020-12-13 01:33:40 +00:00
|
|
|
#!/sbin/openrc-run
|
|
|
|
|
2021-06-01 23:17:41 +00:00
|
|
|
: ${TELEGRAF_CONFIG:=/etc/telegraf.conf}
|
|
|
|
: ${TELEGRAF_CONFIG_DIR:=/etc/telegraf.d/}
|
|
|
|
|
2020-12-13 01:33:40 +00:00
|
|
|
command="/usr/bin/telegraf"
|
2021-06-01 23:17:41 +00:00
|
|
|
command_args="${TELEGRAF_OPTS:---config $TELEGRAF_CONFIG --config-directory $TELEGRAF_CONFIG_DIR}"
|
2020-12-13 01:33:40 +00:00
|
|
|
command_background=yes
|
2020-12-18 20:50:42 +00:00
|
|
|
command_user="${command_user:-telegraf:telegraf}"
|
2020-12-13 01:33:40 +00:00
|
|
|
pidfile="/run/$RC_SVCNAME.pid"
|
|
|
|
extra_started_commands="reload"
|
|
|
|
|
|
|
|
depend() {
|
|
|
|
need net
|
|
|
|
after firewall
|
|
|
|
}
|
|
|
|
|
|
|
|
reload() {
|
|
|
|
ebegin "Reloading ${RC_SVCNAME}"
|
|
|
|
start-stop-daemon --signal HUP --pidfile "${pidfile}"
|
|
|
|
eend $?
|
|
|
|
}
|