Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 444912 - net-nds/openldap-2.4.30 does not create /var/run/openldap
Summary: net-nds/openldap-2.4.30 does not create /var/run/openldap
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo LDAP project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: keepdir-var-run_lock
  Show dependency tree
 
Reported: 2012-11-27 09:51 UTC by sf
Modified: 2014-10-12 06:27 UTC (History)
5 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 sf 2012-11-27 09:51:20 UTC
Recent openrc-0.11.5 put /var/run on tmpfs (see tracker bug #332633). Now because of

# /usr/sbin/slaptest -u  -f /etc/openldap/slapd.conf
50b48cb3 unable to open file "/var/run/openldap/slapd.pid": 2 (No such file or directory)

slapd fails to start:

# /etc/init.d/slapd --debug start
+ _conf_d=/etc/init.d/../conf.d
+ _c=slapd
+ '[' -n slapd -a slapd '!=' slapd ']'
+ unset _c
+ sourcex -e /etc/init.d/../conf.d/slapd.default
+ '[' -e = -e ']'
+ shift
+ '[' -e /etc/init.d/../conf.d/slapd.default ']'
+ return 1
+ sourcex -e /etc/init.d/../conf.d/slapd
+ '[' -e = -e ']'
+ shift
+ '[' -e /etc/init.d/../conf.d/slapd ']'
+ . /etc/init.d/../conf.d/slapd
++ INSTANCE=openldap
++ OPTS_CONF='-f /etc/openldap/slapd.conf'
++ OPTS='-f /etc/openldap/slapd.conf -h '\''ldaps:// ldap:// ldapi://%2fvar%2frun%2fopenldap%2fslapd.sock'\'''
+ unset _conf_d
+ sourcex -e /etc/rc.conf
+ '[' -e = -e ']'
+ shift
+ '[' -e /etc/rc.conf ']'
+ . /etc/rc.conf
++ rc_shell=/sbin/sulogin
++ unicode=YES
++ rc_tty_number=12
++ rc_logger=YES
++ rc_sys=
+ '[' Linux = Linux -a start = start ']'
+ '[' -d /sys/fs/cgroup/openrc ']'
+ mkdir -p /sys/fs/cgroup/openrc/slapd
+ echo 19768
+ '[' -n '' ']'
+ sourcex /etc/init.d/slapd
+ '[' /etc/init.d/slapd = -e ']'
+ . /etc/init.d/slapd
++ extra_commands=checkconfig
++ '[' -z openldap ']'
+ unset _d
+ unset _f
+ '[' -n '' ']'
+ '[' -n start ']'
+ '[' start = depend ']'
+ for _cmd in describe start stop status '${extra_commands:-$opts}' '$extra_started_commands' '$extra_stopped_commands'
+ '[' describe = start ']'
+ for _cmd in describe start stop status '${extra_commands:-$opts}' '$extra_started_commands' '$extra_stopped_commands'
+ '[' start = start ']'
++ command -v start
+ '[' start = start ']'
+ yesno
+ '[' -z '' ']'
+ return 1
+ unset _cmd
+ case $1 in
+ verify_boot
+ '[' '!' -e /run/openrc/softlevel ']'
+ return 0
++ command -v start_pre
+ '[' '' = start_pre ']'
+ start
+ checkconfig -Q
+ /usr/sbin/slaptest -u -Q -f /etc/openldap/slapd.conf
+ eerror 'There is a problem with your slapd.conf!'
 * There is a problem with your slapd.conf!
+ return 1
+ exit 1
 * ERROR: slapd failed to start
Comment 1 Diego Elio Pettenò (RETIRED) gentoo-dev 2012-12-01 23:29:35 UTC
As far as I can tell at least openldap-2.4.33 is installing an init script that is doing checkpath... did you update your init script?
Comment 2 Steven Elling 2012-12-02 03:33:49 UTC
The init script included with net-nds/openldap-2.4.30 runs checkpath but fails with "There is a problem with your slapd.conf!"

The init script does not create /var/run/openldap/ or /run/openldap/ either.  And, yes, I ran etc-update.

I had to comment out that whole section to figure out what was really going on.


Here is the init script from openldap-2.4.30:

#!/sbin/runscript
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-nds/openldap/files/slapd-initd-2.4.28-r1,v 1.2 2012/02/12 21:35:04 robbat2 Exp $

extra_commands="checkconfig"

[ -z "$INSTANCE" ] && INSTANCE="openldap${SVCNAME#slapd}"

depend() {
        need net
        before dbus hald 
        provide ldap
}

start() {
       if ! checkconfig -Q ; then
               eerror "There is a problem with your slapd.conf!"
               return 1
       fi
        ebegin "Starting ldap-server"
        [ -n "$KRB5_KTNAME" ] && export KRB5_KTNAME
        eval start-stop-daemon --start --pidfile /var/run/openldap/${SVCNAME}.pid --exec /usr/lib64/openldap/slapd -- -u ldap -g ldap "${OPTS}"
        eend $?
}

stop() {
        ebegin "Stopping ldap-server"
        start-stop-daemon --stop --signal 2 --quiet --pidfile /var/run/openldap/${SVCNAME}.pid
        eend $?
}

checkconfig() {
        /usr/sbin/slaptest -u "$@" ${OPTS_CONF}
}
Comment 3 sf 2012-12-03 10:07:39 UTC
In May the call to checkpath was added to files/slapd-initd-2.4.28-r1 without bumping then already stable openldap-2.4.30:

http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/net-nds/openldap/files/slapd-initd-2.4.28-r1?r1=1.2&r2=1.3

After recompiling slapd starts.

Please bump now before other users get a non-starting openldap.
Comment 4 Massimiliano Ballerini 2013-01-07 16:55:18 UTC
Got the same problem: have to create /var/run/openldap at every reboot (luckily I don't need to reboot often)

openldap version is: openldap-2.4.30
openrc version is: openrc-0.11.8
Comment 5 Patrick Lauer gentoo-dev 2013-01-13 04:35:47 UTC
This one just bit me. 

WTF. Who "fixes" such a critical issue without revbump? :(
Comment 6 Patrick Lauer gentoo-dev 2013-01-14 02:28:29 UTC
+  14 Jan 2013; Patrick Lauer <patrick@gentoo.org> +openldap-2.3.43-r2.ebuild,
+  files/slapd-initd:
+  Bump 2.3 for init script checkpath change, #444912

This makes 2.3 actually able to start on bootup, which is mildly useful in many scenarios ;)
Comment 7 Kirill Elagin 2013-01-24 17:49:10 UTC
So how about fixing this bug for 2.4.30 which is the latest stable now?

That's funny the bug is open since November and many people are getting not starting slapd now.
Comment 8 Kirill Elagin 2013-01-24 17:51:48 UTC
Oh, I misread the thread. So it _was_ fixed, but no-one still cares to add -r1 to 2.4.30? Brilliant.
Comment 9 Massimiliano Ballerini 2013-01-24 17:56:30 UTC
It's not uncommon since it's an issue you get after a reboot.

I.E. I rebooted my server twice last year, so It's normal I think I noticed the problem only after 3 months.
Comment 10 Massimiliano Ballerini 2013-02-05 11:48:13 UTC
Looked in another gentoo machine with openldap. I noticed this slight difference:

--- /etc/init.d/slapd	2013-02-05 11:59:32.000000000 +0100
+++ ./slapd_old	2013-02-05 12:38:17.000000000 +0100
@@ -14,7 +14,6 @@
 }
 
 start() {
-	checkpath -q -d /var/run/openldap/ -o ldap:ldap
 	if ! checkconfig -Q ; then
 		eerror "There is a problem with your slapd.conf!"
 		return 1

Adding this line make the init script works on the original server too.
The only difference I can think of is that the new gentoo machine is amd64 arch instead of i686.

Could be that? Are init-scripts arch dependent?
Comment 11 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2014-10-12 06:27:37 UTC
in 2.4.40