diff options
Diffstat (limited to 'testing/telegraf/telegraf.initd')
| -rw-r--r-- | testing/telegraf/telegraf.initd | 38 |
1 files changed, 8 insertions, 30 deletions
diff --git a/testing/telegraf/telegraf.initd b/testing/telegraf/telegraf.initd index 16045bcc11..9855687f03 100644 --- a/testing/telegraf/telegraf.initd +++ b/testing/telegraf/telegraf.initd @@ -1,41 +1,19 @@ #!/sbin/openrc-run -NAME=telegraf -DAEMON=/usr/bin/${NAME} +command="/usr/bin/telegraf" +command_args="$TELEGRAF_OPTS" +command_background=yes +command_user=telegraf:telegraf +pidfile="/run/$RC_SVCNAME.pid" +extra_started_commands="reload" depend() { need net after firewall } -start() { - ebegin "Starting ${NAME}" - start-stop-daemon --start --quiet --background \ - --user ${NAME} --make-pidfile --pidfile /var/run/${NAME}.pid \ - --stderr /var/log/${NAME}/${NAME}.log \ - --exec ${DAEMON} -- ${OPTS} -config /etc/${NAME}/${NAME}.conf -config-directory /etc/${NAME}/${NAME}.d - eend $? -} - -stop() { - ebegin "Stopping ${NAME}" - start-stop-daemon --stop --quiet \ - --exec ${DAEMON} \ - --pidfile /var/run/${NAME}.pid \ - eend $? -} - reload() { - ebegin "Reloading ${NAME}" - if ! service_started "${NAME}" ; then - eend 1 "${NAME} is not started" - return 1 - fi - start-stop-daemon --stop --oknodo --signal HUP \ - --exec ${DAEMON} --pidfile /var/run/${NAME}.pid + ebegin "Reloading ${RC_SVCNAME}" + start-stop-daemon --signal HUP --pidfile "${pidfile}" eend $? } - -start_pre() { - checkpath -d -o ${NAME}:${NAME} -m755 /var/lib/${NAME} /var/log/${NAME} -} |
