mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-05-06 17:24:15 +02:00
39 lines
723 B
Bash
39 lines
723 B
Bash
#!/sbin/openrc-run
|
|
|
|
# Sample init.d file for alpine linux.
|
|
|
|
NAME=nagios
|
|
DAEMON=/usr/sbin/$NAME
|
|
|
|
depend() {
|
|
need net
|
|
after firewall
|
|
}
|
|
|
|
start() {
|
|
ebegin "Starting ${NAME}"
|
|
start-stop-daemon --start --quiet --background \
|
|
--make-pidfile --pidfile /var/run/${NAME}.pid \
|
|
--exec ${DAEMON} -- ${OPTS} /etc/nagios/nagios.cfg
|
|
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 $?
|
|
}
|
|
|