Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 13057 - problem with init scripts for openldap 2.0.27
Summary: problem with init scripts for openldap 2.0.27
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Alastair Tse (RETIRED)
URL:
Whiteboard:
Keywords:
: 14416 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-01-01 18:59 UTC by Angel Aray
Modified: 2003-05-11 15:13 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Angel Aray 2003-01-01 18:59:52 UTC
doing a "/etc/init.d/slapd stop" followed by "/etc/init.d/slapd start"  produces the following error: 
 WARNING:  "slapd" has already been started. 
 
Checking at the init scripts it looks to me as if there is an inconsistency between the path to the 
path for the .pid files in the init scripts ie "/var/state/openldap/slapd.pid" and the one specified in  
/etc/openldap/sldap.conf which points to "/var/lib/slapd.pid".
Comment 1 SpanKY gentoo-dev 2003-01-23 08:20:18 UTC
both should really say /var/run/sldap.pid 
Comment 2 SpanKY gentoo-dev 2003-01-23 08:20:27 UTC
*** Bug 14416 has been marked as a duplicate of this bug. ***
Comment 3 Joakim 2003-02-13 16:18:41 UTC
Same with 2.1.12 and probably all others... so are anyone going to fix this? seam to me 
being one of the easiest one around. It defnately have to be in /var/run/ and nowere 
else... 
Comment 4 Joakim 2003-02-13 20:54:41 UTC
Well I was a bit hasty, it appear to be a tricky one but this seam to work, at least for 
version 2.1.12  
 
in /etc/init.d/slapd comment out 
        #touch /var/state/openldap/slapd.pid 
        #chown ldap:ldap /var/state/openldap/slapd.pid 
and change path for pidfile under stop() to 
 
/var/run/openldap/slapd.pid 
 
so the file read: 
 
#!/sbin/runscript 
# Copyright 1999-2002 Gentoo Technologies, Inc. 
# Distributed under the terms of the GNU General Public License, v2 or later 
# $Header: /home/cvsroot/gentoo-x86/net-nds/openldap/files/slapd-2.1-r1.rc6,v 1.1 
2003/01/30 00:18:16 raker Exp $ 
 
depend() { 
        need net 
} 
 
start() { 
        ebegin "Starting ldap-server" 
        start-stop-daemon --start --quiet --exec /usr/lib/openldap/slapd -- -u ldap -g ldap 
${OPTS} 
        #touch /var/state/openldap/slapd.pid 
        #chown ldap:ldap /var/state/openldap/slapd.pid 
        eend $? 
} 
 
stop() { 
        ebegin "Stopping ldap-server" 
        start-stop-daemon --stop --quiet --pidfile /var/run/openldap/slapd.pid --exec 
/usr/lib/openldap/slapd 
        eend $? 
} 
 
do 
#mkdir /var/run/openldap 
#chown ldap:ldap /var/run/openldap 
 
Edit slapd.conf 
#nano -w /etc/openldap/slapd.conf 
 
and set path for pidfile and argsfile to same as above "/var/run/openldap/filename" 
 
There is no need for the start script to creat the pid file. However, there still are 
something strange as the pidfile never get killed but stays and there is also an 
slapd.args file created when openldap startup. Anyhow this seam to work with 2.1.12 
and if some dev bit in on it we might can have a ready-to-go ebuild soon. 
 
I run it with Berkeley 4.1.25 (just used 4.1.24 script and bumped version in scriptname, 
removed "-" infront of x86 and put it in PORTAGE_OVERLAY. x86-1.4 profile have to 
be changed as well to allow bdb newer then current roof 3.2.9 - It all seam to work 
smooth as butter is melting in the sun... with latest cyrus-sasl and kerberos (havn't 
tested that really yet though). 
Comment 5 rojaro 2003-02-17 00:08:34 UTC
Simple Fix:

make the ebuild create the directory "/var/run/openldap"

now change "pidfile" and "argsfile" lines in /etc/openldap/slapd.conf to the following:

  pidfile /var/run/openldap/slapd.pid
  argsfile /var/run/openldap/slapd.args

finally change the --pidfile parameters in the initscript (/etc/init.d/slapd) to the correct paths.
Comment 6 Joakim 2003-02-17 07:22:11 UTC
Right, but the "touch" and "chown" lines have to be removed as well. Openldap fixes 
this on its own and with them at least I get an segmentation error. 
 
But it shall also be noted, to all this to work db-4.1.x are needed. I actually use 4.1.25 
which seam to work fine. I simply took and renamed the 4.1.24 ebuild. There is a patch 
for 4.1.25 as well but I didn't bother with it as it didn't efect me. 
Comment 7 Robert Cole 2003-03-30 02:01:33 UTC
Are we possibly going to just fix all this with 2.1.16 and be done with it?

http://www.openldap.org/software/download/

:)
Comment 8 Alastair Tse (RETIRED) gentoo-dev 2003-05-11 15:13:14 UTC
the init scripts problem has now been fixed for 2.0.27-r3 and also 2.1.19. i'm not going to obselete the older 2.1.x ebuilds in favour of the revamped 2.1.19. 

please report any bugs in a new bug. i'm closing this now.