Bug 587524 - /etc/init.d/ldap is not LSB compliant
/etc/init.d/ldap is not LSB compliant
Status: CLOSED DUPLICATE of bug 587210
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: openldap (Show other bugs)
6.1
All Linux
low Severity low
: rc
: ---
Assigned To: Jan Zeleny
BaseOS QE Security Team
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-04-30 02:56 EDT by Achim Stumpf
Modified: 2010-04-30 03:59 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-04-30 03:18:36 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Achim Stumpf 2010-04-30 02:56:25 EDT
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 03:05:09 EDT
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 03:18:36 EDT
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 03:19:13 EDT
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 03:20:29 EDT
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 03:36:03 EDT
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 03:59:12 EDT
I will ask my managers to give me time for that. But can't promise yet...

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