mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-01-27 19:41:56 +01:00
42 lines
892 B
Plaintext
42 lines
892 B
Plaintext
#!/sbin/openrc-run
|
|
|
|
NAME=telegraf
|
|
DAEMON=/usr/bin/${NAME}
|
|
|
|
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
|
|
eend $?
|
|
}
|
|
|
|
start_pre() {
|
|
checkpath -d -o ${NAME}:${NAME} -m755 /var/lib/${NAME} /var/log/${NAME}
|
|
}
|