Bug 587524

Summary: /etc/init.d/ldap is not LSB compliant
Product: Red Hat Enterprise Linux 6 Reporter: Achim Stumpf <hakim.news>
Component: openldapAssignee: Jan Zeleny <jzeleny>
Status: CLOSED DUPLICATE QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: low Docs Contact:
Priority: low    
Version: 6.1CC: jplans
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-04-30 07:18:36 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Achim Stumpf 2010-04-30 06:56:25 UTC
Description of problem:

For a very urgent cleanup of a heartbeat v1 cluster I recognized, that this
init script is not LSB compliant. See

http://www.linux-ha.org/LSBResourceAgent [^]
http://refspecs.linux-foundation.org/LSB_3.2.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
[^]

From my tests for LSB compliance I got the following result:

[root@cube3service1 ha.d]# /etc/init.d/ldap start
Checking configuration files for slapd: config file testing succeeded
                                                           [ OK ]
Starting slapd: [ OK ]
Starting slurpd: [ OK ]
[root@cube3service1 ha.d]# echo $?
0
[root@cube3service1 ha.d]# /etc/init.d/ldap status
slapd (pid 31953) is running...
slurpd (pid 31960) is running...
[root@cube3service1 ha.d]# echo $?
0


[root@cube3service1 ha.d]# /etc/init.d/ldap start
Checking configuration files for slapd: config file testing succeeded
                                                           [ OK ]
Starting slapd: [FAILED]

[root@cube3service1 ha.d]# echo $?
1
#
# should return 0 and services should not start a second time
#

[root@cube3service1 ha.d]# /etc/init.d/ldap stop
Stopping slapd: [ OK ]
Stopping slurpd: [ OK ]
[root@cube3service1 ha.d]# echo $?
0
[root@cube3service1 ha.d]# /etc/init.d/ldap status
slapd is stopped
slurpd is stopped
[root@cube3service1 ha.d]# echo $?
3
[root@cube3service1 ha.d]# /etc/init.d/ldap stop
Stopping slapd: [FAILED]
Stopping slurpd: [FAILED]
[root@cube3service1 ha.d]# echo $?
0

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:


Actual results:


Expected results:


Additional info:

Here is my patch to fix this:

$ svn diff -r 325 ldap
Index: ldap
===================================================================
--- ldap (revision 325)
+++ ldap (working copy)
@@ -199,29 +199,39 @@
     return $RETVAL
 }

+function status_ldap() {
+ status ${slapd}
+ RETVAL=$?
+ if grep -q "^replogfile" /etc/openldap/slapd.conf ; then
+ status ${slurpd}
+ RET=$?
+ if [ $RET -ne 0 ] ; then
+ RETVAL=$RET;
+ fi
+ fi
+ return $RETVAL
+}
+
 # See how we were called.
 case "$1" in
     configtest)
     configtest
     ;;
     start)
- start
- RETVAL=$?
+ status_ldap
+ RETVAL=$?
+ if [ $RETVAL -ne 0 ]; then
+ start
+ RETVAL=$?
+ fi
     ;;
     stop)
     stop
     RETVAL=$?
     ;;
     status)
- status ${slapd}
- RETVAL=$?
- if grep -q "^replogfile" /etc/openldap/slapd.conf ; then
- status ${slurpd}
- RET=$?
- if [ $RET -ne 0 ] ; then
- RETVAL=$RET;
- fi
- fi
+ status_ldap
+ RETVAL=$?
     ;;
     restart)
     stop

This is a diff to the original version as I have got it on Centos 5.4. I know
it is quick and dirty, haven't got the time to fix it nicely.

Comment 1 Achim Stumpf 2010-04-30 07:05:09 UTC
Sorry,

I have posted this already in 

http://bugs.centos.org/view.php?id=4293

Here I got the advice to post it in 

https://bugzilla.redhat.com/show_bug.cgi?id=587210

Here I got the advice to install a rhel 6 beta, and if this issue persists I should report here.

My company has a support contract for rhel. If this might help here ;o)

Comment 2 Jan Zeleny 2010-04-30 07:18:36 UTC
As I stated in original bug, this issue has been already fixed in Fedora 12, from
which RHEL6 is derived. Feel free to reopen the bug if you find that the issue
hasn't really been fixed. I'm closing it as duplicate for now.

*** This bug has been marked as a duplicate of bug 587210 ***

Comment 3 Achim Stumpf 2010-04-30 07:19:13 UTC
Sorry,

I have posted this already in 

http://bugs.centos.org/view.php?id=4293

Here I got the advice to post it in 

https://bugzilla.redhat.com/show_bug.cgi?id=587210

Here I got the advice to install a rhel 6 beta, and if this issue persists I should report here. Sorry I haven't a installation of rhel 6. And this story costs me to much time just to address this bug. I have searched around, but haven't found anything where someone fixed this issue for rhel.

Please check...

My company has a support contract for rhel. If this might help here ;o)

Comment 4 Achim Stumpf 2010-04-30 07:20:29 UTC
Ok if it is fixed, I am fine with that. Sorry for my bad english, but I understood in the other thread, that yu are not sure if this is fixed.

This seems to be done then...

Comment 5 Jan Zeleny 2010-04-30 07:36:03 UTC
No problem - my point was that the issue is fixed (it passed internal test written by our QA), but of course you might have different test which can detect anomaly unlisted in Fedora guidelines.

If you happen to find something that you think is an issue, please file a new bug for it, so we can discuss it further. But in this case sooner is better - once RHEL6 reaches beta2, it will be difficult to get init script change into it.

Comment 6 Achim Stumpf 2010-04-30 07:59:12 UTC
I will ask my managers to give me time for that. But can't promise yet...