aboutsummaryrefslogtreecommitdiffstats
path: root/main/nagios/nagios.initd
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2010-06-04 06:51:50 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2010-06-04 06:51:50 +0000
commit8d7190c2c9b5628b8c80d2c636cc151ecc2432f3 (patch)
tree089ccd761f4c3e497e3b3f83aad5243602d8a13c /main/nagios/nagios.initd
parent8136831e39f64dac7667d9318ea80ed821a12903 (diff)
downloadaports-8d7190c2c9b5628b8c80d2c636cc151ecc2432f3.tar.bz2
aports-8d7190c2c9b5628b8c80d2c636cc151ecc2432f3.tar.xz
main/nagios: moved from testing
Diffstat (limited to 'main/nagios/nagios.initd')
-rw-r--r--main/nagios/nagios.initd39
1 files changed, 39 insertions, 0 deletions
diff --git a/main/nagios/nagios.initd b/main/nagios/nagios.initd
new file mode 100644
index 0000000000..e0b3bcf0c3
--- /dev/null
+++ b/main/nagios/nagios.initd
@@ -0,0 +1,39 @@
+#!/sbin/runscript
+
+# 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 $?
+}
+