/etc/init.d/nagios3 status returns 0 if nagios isn't running

Bug #367679 reported by Mikel Ward
2
Affects Status Importance Assigned to Milestone
nagios3 (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

The init.d script says status OK even when the Nagios daemon is not running.

$ sudo /etc/init.d/nagios3 status
 * checking /usr/sbin/nagios3... [ OK ]
$ sudo pgrep nagios
(no output)

It's because the script is passing 0 to the log function rather than 1.

$ diff -u nagios3.old nagios3
--- nagios3.old 2009-04-27 11:04:18.000000000 +1000
+++ nagios3 2009-04-27 11:04:25.000000000 +1000
@@ -180,7 +180,7 @@
       log_action_end_msg 1 "$DAEMON failed"
       exit 1
     else
- log_action_end_msg 0 "not running"
+ log_action_end_msg 1 "not running"
       exit 3
     fi
   fi

Now it does what I think it should:
$ sudo /etc/init.d/nagios3 status
 * checking /usr/sbin/nagios3... [fail]

(spaces between ... and [] were omitted for brevity)

$ dpkg -l nagios3
ii nagios3 3.0.2-1ubuntu1.1 A host/service/network monitoring and management system

Ubuntu 8.04 with latest updates.

Revision history for this message
Thierry Carrez (ttx) wrote :

You mean Ubuntu 8.10, right ? There is no nagios3 package in 8.04.

Changed in nagios3 (Ubuntu):
assignee: nobody → ttx
importance: Undecided → Low
status: New → Confirmed
Thierry Carrez (ttx)
Changed in nagios3 (Ubuntu):
assignee: ttx → nobody
Revision history for this message
Mikel Ward (mikelward) wrote :

Yes, sorry, Ubuntu 8.10.

I tried cat /etc/debian_version, but it just said lenny or something like that.

Is there a proper command to run to show that information?

Revision history for this message
Chuck Short (zulcss) wrote :

This has been fixed for karmic already.

Regads
chuck

Changed in nagios3 (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.