2020-12-13 01:33:40 +00:00
|
|
|
#!/sbin/openrc-run
|
|
|
|
|
|
|
|
command="/usr/bin/telegraf"
|
|
|
|
command_args="$TELEGRAF_OPTS"
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
start_pre() {
|
|
|
|
checkpath -f -o $command_user -m 640 ${TELEGRAF_CONFIG:-/etc/telegraf.conf}
|
|
|
|
}
|
|
|
|
|
|
|
|
reload() {
|
|
|
|
ebegin "Reloading ${RC_SVCNAME}"
|
|
|
|
start-stop-daemon --signal HUP --pidfile "${pidfile}"
|
|
|
|
eend $?
|
|
|
|
}
|