Bug 72237 - starting slapd doesn't create /var/run/slapd.pid
Summary: starting slapd doesn't create /var/run/slapd.pid
Keywords:
Status: CLOSED CANTFIX
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: openldap
Version: 7.3
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jay Fenlason
QA Contact: Jay Turner
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-08-22 09:36 UTC by Maurizio Marini
Modified: 2015-01-07 23:59 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-10-18 14:11:07 UTC
Embargoed:


Attachments (Terms of Use)

Description Maurizio Marini 2002-08-22 09:36:46 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (compatible; Konqueror/3.0.0-10; Linux)

Description of problem:
I'm using openldap-2.0.23-4
When slapd is startd by /etc/init.d/ldap start, no pid file is created, so querying /etc/init.d/ldap status report:
[root@iris /usr/lib]# /etc/init.d/ldap status
slapd dead but pid file exists
slurpd is stopped

NB: i've pidfile /var/run/slapd.pid in my /etc/openldap/slapd.conf


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


How reproducible:
Always

Steps to Reproduce:
1./etc/init.d/ldap start
2.ls -la /var/run/slapd.pid
3.
 

Actual Results:  no pid file is created  

Additional info:

slapd tries to create /var/run/slapd.pid after changing user to ldap
so, as ldap user, he is unable to create anything.
In original package, pidfile was placed under /var/lib/ldap, and this dir is chowned to ldap user.
If u change slapd.conf with pidfile /var/lib/ldap/slapd.pid, then functions script is unable to find it.

Comment 1 Charlie Brady 2002-08-29 17:07:20 UTC
Here's a quick hack which works around the problem. The real problem is in
slapd. I'd argue that it shouldn't write its pid into an "ldap" owned file. That
would allow mischief if slapd were compromised. 

--- ldap.init.redhat	Tue Jul  3 16:09:55 2001
+++ ldap.init	Thu Aug 29 13:03:14 2002
@@ -34,6 +34,8 @@
 
 function start() {
         # Start daemons.
+
touch /var/run/slapd.pid
+
chown ldap /var/run/slapd.pid
 	prog=`basename ${slapd}`
         echo -n $"Starting $prog: "
 	if grep -q ^TLS /etc/openldap/slapd.conf ; then
@@ -53,7 +55,17 @@
 
	echo
             fi
 	fi
-
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/ldap
+
if [ $RETVAL -eq 0 ]
+
then
+
    touch /var/lock/subsys/ldap
+
    # Giv slapd time to write its pid file, then chown pidfile to root
+
    [ -s /var/run/slapd.pid ] || sleep 1
+
    [ -s /var/run/slapd.pid ] || sleep 2
+
    [ -s /var/run/slapd.pid ] || sleep 4
+
    chown root /var/run/slapd.pid
+
else
+
    rm /var/run/slapd.pid
+
fi
 	return $RETVAL
 }
 


Comment 2 Maurizio Marini 2002-08-29 17:32:03 UTC
great :-P

Comment 3 Bill Nottingham 2006-08-04 21:35:20 UTC
Red Hat apologizes that these issues have not been resolved yet. We do want to
make sure that no important bugs slip through the cracks.

Red Hat Linux 7.3 and Red Hat Linux 9 are no longer supported by Red Hat, Inc.
They are maintained by the Fedora Legacy project (http://www.fedoralegacy.org/)
for security updates only. If this is a security issue, please reassign to the
'Fedora Legacy' product in bugzilla. Please note that Legacy security update
support for these products will stop on December 31st, 2006.

If this is not a security issue, please check if this issue is still present
in a current Fedora Core release. If so, please change the product and version
to match, and check the box indicating that the requested information has been
provided.

If you are currently still running Red Hat Linux 7.3 or 9, please note that
Fedora Legacy security update support for these products will stop on December
31st, 2006. You are strongly advised to upgrade to a current Fedora Core release
or Red Hat Enterprise Linux or comparable. Some information on which option may
be right for you is available at http://www.redhat.com/rhel/migrate/redhatlinux/.

Any bug still open against Red Hat Linux 7.3 or 9 at the end of 2006 will be
closed 'CANTFIX'. Again, if this bug still exists in a current release, or is a
security issue, please change the product as necessary. We thank you for your
help, and apologize again that we haven't handled these issues to this point.


Comment 4 Bill Nottingham 2006-10-18 14:11:07 UTC
Red Hat Linux is no longer supported by Red Hat, Inc. If you are still
running Red Hat Linux, you are strongly advised to upgrade to a
current Fedora Core release or Red Hat Enterprise Linux or comparable.
Some information on which option may be right for you is available at
http://www.redhat.com/rhel/migrate/redhatlinux/.

Closing as CANTFIX.


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