[Pkg-nagios-devel] Bug#437659: nagios2-common: /etc/init.d/nagios2 and comments in nagios.cfg

root rw+bug at coretec.at
Mon Aug 13 13:44:57 UTC 2007

Package: nagios2-common
Version: 2.6-2+etch1
Severity: normal

In /etc/init.d/nagios there's this line:
THEPIDFILE="$(grep lock_file $NAGIOSCFG | awk -v FS="=" '{print $2}')"

Which, quite obviously, doesn't DTRT when it encounters a commented-out
line in $NAGIOSCFG.

IMHO it should do something like the following:

--- nagios2.orig        2007-08-13 15:37:39.000000000 +0200
+++ nagios2     2007-08-09 16:15:13.000000000 +0200
@@ -114,7 +114,8 @@
   exit 6
-THEPIDFILE="$(grep lock_file $NAGIOSCFG | awk -v FS="=" '{print $2}')"
+# THEPIDFILE="$(grep lock_file $NAGIOSCFG | awk -v FS="=" '{print $2}')"
+THEPIDFILE="$(grep lock_file $NAGIOSCFG | egrep -v "^\#" | awk -v FS="=" '{print $2}')"
 [ -n "$THEPIDFILE" ] || THEPIDFILE='/var/run/nagios2/nagios.pid'
 [ -e "$THEPIDFILE" ] && PID=$(cat $THEPIDFILE)


-- System Information:
Debian Release: 4.0
  APT prefers stable
  APT policy: (990, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-4-686-bigmem
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)

Versions of packages nagios2-common depends on:
ii  adduser          3.102                   Add and remove users and groups
ii  apache [httpd]   1.3.34-4.1              versatile, high-performance HTTP s
ii  apache-ssl [http 1.3.34-4.1              versatile, high-performance HTTP s
ii  coreutils        5.97-5.3                The GNU core utilities
ii  debconf [debconf 1.5.11                  Debian configuration management sy
ii  lsb-base         3.1-23.1                Linux Standard Base 3.1 init scrip
ii  mailx            1:8.1.2-0.20050715cvs-1 A simple mail user agent
ii  nagios-plugins-b 1.4.5-1                 Plugins for the nagios network mon
ii  nagios2-doc      2.6-2+etch1             documentation for nagios2
ii  ucf              2.0020                  Update Configuration File: preserv

Versions of packages nagios2-common recommends:
ii  nagios-images                 0.3        Collection of images and icons for
ii  nagios-plugins                1.4.5-1    Plugins for the nagios network mon

-- debconf information excluded

Ooe. Gesundheits- und Spitals-AG
Techcenter, Hafenstrasse 47-51, 4020 Linz
DVR 2107870, ATU 51928204, Firmenbuchgericht: Landesgericht Linz, FN 210146 p

More information about the Pkg-nagios-devel mailing list