Bug 546561 - /etc/init.d/nagios status always returns 0
Summary: /etc/init.d/nagios status always returns 0
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: nagios
Version: 12
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Peter Lemenkov
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-12-11 08:49 UTC by Ricky Zhou
Modified: 2010-03-09 03:37 UTC (History)
5 users (show)

Fixed In Version: nagios-3.2.0-4.fc11
Clone Of:
Environment:
Last Closed: 2010-03-09 03:16:04 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
[PATCH] Fix status return code and nagios.pid SELinux context. (825 bytes, patch)
2009-12-11 08:49 UTC, Ricky Zhou
no flags Details | Diff
Fix status return code and nagios.pid SELinux context. (826 bytes, patch)
2010-02-09 07:35 UTC, Ricky Zhou
no flags Details | Diff

Description Ricky Zhou 2009-12-11 08:49:27 UTC
Created attachment 377691 [details]
[PATCH] Fix status return code and nagios.pid SELinux context.

Description of problem:
/etc/init.d/nagios status always returns 0, even when nagios is not running.

Version-Release number of selected component (if applicable):
nagios-3.2.0-2.fc12.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Stop nagios
2. Run /etc/init.d/nagios status
3. echo $?
  
Actual results:
Returns 0

Expected results:
Return non-zero status.


Additional info:
The initscript included in the nagios tarball is honestly kind of a nightmare,
but the attached patch fixes the issue for now.

The patch also includes Daniel Walsh's SELinux-related fix from bug #539963.

Comment 1 Ricky Zhou 2010-01-20 16:16:45 UTC
Reassigning to new owners.

Comment 2 J. David Beutel 2010-02-09 06:49:56 UTC
In the attached patch, the

if [ $RETVAL = 0]; then

maybe should be

if [ $RETVAL = 0 ]; then

Comment 3 Ricky Zhou 2010-02-09 07:35:01 UTC
Created attachment 389690 [details]
Fix status return code and nagios.pid SELinux context.

Good catch, here's a new patch with your fix.

Comment 4 Ricky Zhou 2010-02-21 20:57:21 UTC
Ping, any update on this?  This is breaking tools (like puppet) that depend on the return status of initscripts to tell if nagios is running, and the SELinux issue is making the initscript fail on machines with SELinux enforcing.

Comment 5 Peter Lemenkov 2010-02-22 05:09:26 UTC
I'll fix it very soon. Thanks you for patch.

Comment 6 Fedora Update System 2010-02-25 12:16:46 UTC
nagios-3.2.0-4.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/nagios-3.2.0-4.fc12

Comment 7 Fedora Update System 2010-02-25 12:17:12 UTC
nagios-3.2.0-4.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/nagios-3.2.0-4.fc13

Comment 8 Fedora Update System 2010-02-25 12:17:35 UTC
nagios-3.2.0-4.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/nagios-3.2.0-4.fc11

Comment 9 Fedora Update System 2010-02-26 03:36:39 UTC
nagios-3.2.0-4.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update nagios'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2010-2903

Comment 10 Fedora Update System 2010-02-26 03:37:44 UTC
nagios-3.2.0-4.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update nagios'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F12/FEDORA-2010-2917

Comment 11 Fedora Update System 2010-02-26 03:45:43 UTC
nagios-3.2.0-4.fc13 has been pushed to the Fedora 13 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update nagios'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F13/FEDORA-2010-2957

Comment 12 Fedora Update System 2010-03-09 03:15:38 UTC
nagios-3.2.0-4.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 13 Fedora Update System 2010-03-09 03:27:12 UTC
nagios-3.2.0-4.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 14 Fedora Update System 2010-03-09 03:36:43 UTC
nagios-3.2.0-4.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.