[Pkg-nagios-changes] [pkg-nagios] r1174 - nagios2/trunk/debian

Sean Finney seanius at alioth.debian.org
Sat Jun 9 09:29:12 UTC 2007


Author: seanius
Date: 2007-06-09 09:29:12 +0000 (Sat, 09 Jun 2007)
New Revision: 1174

Modified:
   nagios2/trunk/debian/changelog
   nagios2/trunk/debian/nagios2-common.nagios2.init
Log:
init script fixes


Modified: nagios2/trunk/debian/changelog
===================================================================
--- nagios2/trunk/debian/changelog	2007-06-06 14:38:59 UTC (rev 1173)
+++ nagios2/trunk/debian/changelog	2007-06-09 09:29:12 UTC (rev 1174)
@@ -1,4 +1,4 @@
-nagios2 (2.9-3~0) UNRELEASED; urgency=low
+nagios2 (2.9-1~0) UNRELEASED; urgency=low
 
   * NOT RELEASED YET
   * New upstream release (closes: #414647).
@@ -7,13 +7,13 @@
     (closes: #413122).
   * Fix wrong path to debian.gd2 in extinfo_nagios2.cfg (closes: #423639).
   [Sean Finney]
-  * new upstream contains various fixes in init script
-    (closes: #416763, #397289, #414050, #412980, #415752,
+  * various fixes/cleanups in init script should resolve issues with
+    pidfile handling etc (closes: #416763, #397289, #414050, #412980, #415752).
   * Merge config file changes.
   * add note for pam_tmpdir users about setting TMPDIR in
     /etc/nagios2/default.  thanks to Richard A Nelson (closes: #414652)
 
- -- Marc Haber <mh+debian-packages at zugschlus.de>  Wed, 06 Jun 2007 16:37:56 +0200
+ -- sean finney <seanius at debian.org>  Sat, 09 Jun 2007 11:27:42 +0200
 
 nagios2 (2.6-3) unstable; urgency=low
 

Modified: nagios2/trunk/debian/nagios2-common.nagios2.init
===================================================================
--- nagios2/trunk/debian/nagios2-common.nagios2.init	2007-06-06 14:38:59 UTC (rev 1173)
+++ nagios2/trunk/debian/nagios2-common.nagios2.init	2007-06-09 09:29:12 UTC (rev 1174)
@@ -51,7 +51,7 @@
 }
 
 check_started () {
-  check_cmd="$(get_config "nagios_check_command" "$CGICFG")"
+  check_cmd=$(get_config nagios_check_command $CGICFG)
   if [ ! "$check_cmd" ]; then
     log 6 "unable to determine nagios_check_command from $CGICFG!" 
     return 6
@@ -114,15 +114,11 @@
   exit 6
 fi
 
-THEPIDFILE="$(grep lock_file $NAGIOSCFG | awk -v FS="=" '{print $2}')"
+THEPIDFILE=$(get_config "lock_file")
 [ -n "$THEPIDFILE" ] || THEPIDFILE='/var/run/nagios2/nagios.pid'
 
-[ -e "$THEPIDFILE" ] && PID=$(cat $THEPIDFILE)
-
-[ "$PID" = '1' ] && unset PID
-
 start () {
-  DIRECTORY=$(echo $THEPIDFILE | sed 's!/[^/]\+$!!')
+  DIRECTORY=$(dirname $THEPIDFILE)
   [ ! -d $DIRECTORY ] && mkdir -p $DIRECTORY
   chown nagios:nagios $DIRECTORY
 
@@ -148,13 +144,8 @@
 }
 
 stop () {
-    if [ -n "$PID" ]; then
-      kill -15 -"$PID"
-      ret=$?
-    else
-      killproc -p $THEPIDFILE
-      ret=$?
-    fi
+    killproc -p $THEPIDFILE
+    ret=$?
     if ! check_named_pipe; then
       rm -f $nagiospipe
     fi
@@ -168,7 +159,7 @@
 status()
 {
   log_action_begin_msg "checking $DAEMON"
-  if start-stop-daemon --stop --signal 0 --quiet --pid $THEPIDFILE >/dev/null; then
+  if check_started; then
     log_action_end_msg 0 "running"
   else
     if [ -e "$THEPIDFILE" ]; then




More information about the Pkg-nagios-changes mailing list