Bug 754922

Summary: ndo2bd init script sanity checks problem
Product: [Fedora] Fedora Reporter: Sébastien PRUD'HOMME <sebastien.prudhomme>
Component: ndoutilsAssignee: Simone Caronni <negativo17>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 19   
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-03 13:43:14 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Sébastien PRUD'HOMME 2011-11-18 09:04:39 UTC
Description of problem:

Init script /etc/rc.d/init.d/ndo2db contains these 3 lines :

------------------------------
# Sanity checks.
[ -f /etc/nagios/ndo2db.cfg ] || exit 0
[ -x /usr/sbin/ndo2db ] || exit 0
------------------------------

Exit code should never return 0. It means that every start/stop/status operation returns a success code.

In my case ndoutils in used in a Heartbeat cluster environement and /etc/nagios/ndo2db.cfg is a soft link to a shared disk that is mounted only on one node of the cluster (the active one).

When Heartbeat checks whether ndo2b is running on the passive node, it does a "service ndo2db status" which return 0 (as the shared disk is not mounted). Heartbeat then thinks that ndo2db is running on the passive node and tries to do thinks that breaks the cluster.

Comment 1 Steve Traylen 2011-11-18 09:20:48 UTC
Agreed

It should return 6 in such cases.

http://fedoraproject.org/wiki/Packaging:SysVInitScript#Exit_Codes_for_non-Status_Actions

However for your case where the config file is actually somewhere else the default
could be overwritten by and entry in /etc/sysconfig/ndo2db

Also I could change 

[ -f /etc/nagios/ndo2db.cfg ] || exit 0
to
[ -r /etc/nagios/ndo2db.cfg ] || exit 5

which is probably better anyway. Please could you confirm this would resolve the situation 
for you.

Steve.

Comment 2 Sébastien PRUD'HOMME 2011-11-18 20:41:05 UTC
Hi,

What i'have done is move the sanity checks in the "start" part in the init script and use :

[ -f /etc/nagios/ndo2db.cfg ] || exit 6
[ -x /usr/sbin/ndo2db ] || exit 5

I didn't change the test from "-f" to "-r".

I have no more problem since this change.

Comment 3 Steve Traylen 2011-11-18 20:49:47 UTC
The test must remain.

But it can change such that it does not fail for case where the file
is a symbolic link to a real file.

I believe '-r' should do it.

Steve.

Comment 4 Fedora End Of Life 2013-04-03 19:44:48 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.

(As we did not run this process for some time, it could affect also pre-Fedora 19 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19

Comment 5 Simone Caronni 2014-06-03 13:43:14 UTC
Thanks for re-assigning, I was not aware of the ticket.

After a re-review a few months ago, the package was succesfully re-imported in Fedora for all supported Fedora releases (19 up to rawhide) with version 2.0.0.

Everything is extensively different, it also has systemd scripts in place of SysV init scripts, so this bug is no longer valid.