[Pkg-nagios-changes] [pkg-icinga2] 06/12: updated initscript
Markus Frosch
lazyfrosch-guest at alioth.debian.org
Tue Oct 15 18:43:25 UTC 2013
This is an automated email from the git hooks/post-receive script.
lazyfrosch-guest pushed a commit to branch master
in repository pkg-icinga2.
commit 4e8793107fb8e37ee12577c1cde1d4fde1c5d2c3
Author: Markus Frosch <markus at lazyfrosch.de>
Date: Tue Oct 15 14:17:02 2013 +0200
updated initscript
---
debian/icinga2-common.icinga2.init | 17 +++++++++++++++--
debian/rules | 3 +++
2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/debian/icinga2-common.icinga2.init b/debian/icinga2-common.icinga2.init
index 32c7bf9..d025d96 100644
--- a/debian/icinga2-common.icinga2.init
+++ b/debian/icinga2-common.icinga2.init
@@ -10,14 +10,15 @@
### END INIT INFO
# Author: Alexander Wirt <formorer at debian.org>
+# Markus Frosch <markus at lazyfrosch.de>
# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="icinga2 monitoring daemon"
NAME=icinga2
-DAEMON=/usr/bin/icinga2
+DAEMON=/usr/sbin/icinga2
DAEMON_ARGS="-c /etc/icinga2/icinga2.conf -d"
-PIDFILE=/var/run/$NAME.pid
+PIDFILE=/var/run/icinga2/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
# Exit if the package is not installed
@@ -34,6 +35,16 @@ SCRIPTNAME=/etc/init.d/$NAME
# and status_of_proc is working.
. /lib/lsb/init-functions
+# check run directory
+check_run () {
+ if [ ! -d '/var/run/icinga2' ];
+ then
+ mkdir /var/run/icinga2
+ chown nagios:nagios /var/run/icinga2
+ chmod 0750 /var/run/icinga2
+ fi
+}
+
#
# Function that starts the daemon/service
#
@@ -92,6 +103,8 @@ do_reload() {
return 0
}
+check_run
+
case "$1" in
start)
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
diff --git a/debian/rules b/debian/rules
index a9758ad..6ca475d 100755
--- a/debian/rules
+++ b/debian/rules
@@ -41,4 +41,7 @@ override_dh_auto_install:
# cleanup dependencies in .la files
sed -i "/dependency_libs/ s/'.*'/''/" `find debian/tmp/ -name '*.la'`
+override_dh_installinit:
+ dh_installinit --name=icinga2
+
# vi: noexpandtab :
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-nagios/pkg-icinga2.git
More information about the Pkg-nagios-changes
mailing list