Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 401801 - net-nds/openldap-2.4.24: slapd does not start up when dbus is installed
Summary: net-nds/openldap-2.4.24: slapd does not start up when dbus is installed
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo LDAP project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-01 14:11 UTC by stathis
Modified: 2012-12-17 11:03 UTC (History)
0 users

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 stathis 2012-02-01 14:11:33 UTC
There seems to be a problem with init dependencies. I have net-nds/openldap-2.4.24 installed and sys-apps/dbus-1.4.16.
When my system boots slapd fails to start. See the rc.log below.

<snip>
rc default logging started at Mon Jan 30 08:21:00 2012
 
 * Starting syslog-ng ...
 [ ok ]
 * Starting DHCP Client Daemon ...
 [ ok ]
 * Bringing up interface lo
 *   Caching network module dependencies
 *   127.0.0.1/8 ...
 [ ok ]
 *   Adding routes
 *     127.0.0.0/8 via 127.0.0.1 ...
 [ ok ]
 * Bringing up interface eth1
 *   192.168.77.1 ...
 [ ok ]
 * Bringing up interface wlan0
 *   192.168.99.1 ...
 [ ok ]
 * ERROR: cannot start slapd as net.eth0 would not start
 * Starting D-BUS system messagebus ...
dbus[2390]: nss_ldap: could not search LDAP server - Server is unavailable
dbus[2390]: nss_ldap: could not search LDAP server - Server is unavailable
 [ ok ]
 * Bringing up interface eth0
 *   192.168.2.10 ...
 [ ok ]
 *   Adding routes
 *     default gw 192.168.2.1 ...
 [ ok ]
</snip>


From what I understand the init script of OpenLDAP (/etc/init.d/slapd) requires that slapd be started AFTER net has been provided but BEFORE dbus. 
That would be

(1) net
(2) slapd
(3) dbus

However, I noticed that in the network interface startup scripts /etc/init.d/net.XXX it reads:

26   case "${IFACE}" in
27      lo|lo0);;
28      *) after net.lo net.lo0 dbus;;
29   esac

So all network interfaces apart from localhost shall be started AFTER dbus.

This seems to be the root cause of the problem with slapd, as network is provided by net.lo to slapd that tries to starts, while net.eth0 is to start after dbus.
I tried adding the following lines in my /etc/conf.d/net to fix it but it didn't work out:

rc_net_lo_provide="!net"
rc_net_eth0_provide="net"
rc_net_eth1_provide="!net"
rc_net_wlan0_provide="!net" 

My solution (so that slapd starts up) was to edit the init script of slapd (/etc/init.d/slapd) to remove the dbus requirement:

8   before dbus hald avahi-daemon

changed to:

8   before hald avahi-daemon
   
I'm not sure what are the implications of this or whether it would be better to fix this in the network startup script or somewhere else.

Reproducible: Always




Portage 2.1.10.44 (default/linux/amd64/10.0/server, gcc-4.5.3, glibc-2.13-r4, 3.2.2 x86_64)
=================================================================
System uname: Linux-3.2.2-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q9400_@_2.66GHz-with-gentoo-2.0.3
Timestamp of tree: Wed, 01 Feb 2012 04:15:01 +0000
app-shells/bash:          4.1_p9
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.6.6-r2, 2.7.2-r3, 3.1.4-r3
dev-util/cmake:           2.8.6-r4
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.0.3
sys-apps/openrc:          0.9.8.4
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.9.6-r3, 1.11.1
sys-devel/binutils:       2.21.1-r1
sys-devel/gcc:            4.5.3-r1
sys-devel/gcc-config:     1.4.1-r1
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r1
sys-kernel/linux-headers: 3.1 (virtual/os-headers)
sys-libs/glibc:           2.13-r4
Repositories: gentoo
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=core2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -march=core2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs collision-protect distlocks ebuild-locks fixlafiles multilib-strict news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://ftp.ntua.gr/pub/linux/gentoo/"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X acl amd64 apache2 bash-completion berkdb bzip2 cleartype cli corefonts cracklib crypt cups cxx dbus dri fortran gdbm gpm iconv ipv6 java jpeg kde ldap mmx modules mudflap multilib mysql ncurses nls nptl nptlonly opengl openmp pam pcre php png pppd qt3support readline samba sasl session snmp sql sqlite sqlite3 sse sse2 ssl svg sysfs tcpd threads tiff truetype type1 unicode userlocales webkit xattr xml xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgid dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info ldap log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="intel" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2012-02-12 01:02:32 UTC
InCVS.
Comment 2 stathis 2012-02-26 12:36:31 UTC
(In reply to comment #1)
> InCVS.

Robin thanks for looking into it. It seems this is still a problem in a newer version.

I just upgraded to openldap-2.4.28-r1 and I noticed the new option in /etc/conf.d/slapd, rc_need="XXX". I added the interface I had problems with (rc_need="net.eth0"), but this does not work as expected. I now have the same problem again, with slapd attempting to start before dbus.

I looked at the newer /etc/init.d/slapd and it has again:

12    before dbus hald

and there is still in /etc/init.d/net.lo

28      *) after net.lo net.lo0 dbus;;  (I removed dbus from here to properly fix it)

I ended up removing "dbus" as a prerequisite for any network interface, which makes sense to me and I left /etc/init.d/slapd as is this time.
I think to properly solve this a decision must be made if dbus is necessary for any interfaces to be started. I think it shouldn't be there.

I attach you my rc.log (before editing them to make it work), it may help you understand what is happening. 

cheers



rc default logging started at Sun Feb 26 13:37:00 2012

 * Starting syslog-ng ...
 [ ok ]
 * Starting DHCP Client Daemon ...
 [ ok ]
 * Bringing up interface lo
 *   127.0.0.1/8 ...
 [ ok ]
 *   Adding routes
 *     127.0.0.0/8 via 127.0.0.1 ...
 [ ok ]
 * Bringing up interface eth1
 *   192.168.77.1 ...
 [ ok ]
 * Bringing up interface wlan0
 *   192.168.99.1 ...
 [ ok ]
 * ERROR: cannot start slapd as net.eth0 would not start
 * Starting D-BUS system messagebus ...
dbus[2373]: nss_ldap: could not search LDAP server - Server is unavailable
dbus[2373]: nss_ldap: could not search LDAP server - Server is unavailable
 [ ok ]
 * Bringing up interface eth0
 *   192.168.2.10 ...
 [ ok ]
 *   Adding routes
 *     default gw 192.168.2.1 ...
 [ ok ]
 * Starting mysql ...
 [ ok ]
 * Mounting network filesystems ...
  [ ok ]
 * Use of the opts variable is deprecated and will be
 * removed in the future.
 * Please use extra_commands, extra_started_commands or extra_stopped_commands.
ldap_connect: (TLS) ldap_start_tls(): Can't contact LDAP server (-1)
[LDAP] could not initialize ldap connection
 * Starting sshd ...
ldap_connect: (TLS) ldap_start_tls(): Can't contact LDAP server (-1)
[LDAP] could not initialize ldap connection
 [ ok ]
 * Starting apache2 ...
apache2: Could not reliably determine the server's fully qualified domain name, using 192.168.77.1 for ServerName
 [ ok ]
 * Starting APC UPS daemon ...
 [ ok ]
 * Starting BackupPC ...
 * WARNING: -c/--chuid is deprecated and will be removed in the future, please use -u/--user instead
 [ ok ]
 * Starting ConsoleKit daemon ...
 [ ok ]
 * Starting courier-authlib: authdaemond ...
 [ ok ]
 * Starting courier-imapd over SSL ...
 [ ok ]
 * Starting ddclient ...
 [ ok ]
 * Starting dhcpd ...
 [ ok ]
 * Use of the opts variable is deprecated and will be
 * removed in the future.
 * Please use extra_commands, extra_started_commands or extra_stopped_commands.
 * Starting hostapd ...
 [ ok ]
 * Loading lm_sensors modules...
 *   Loading coretemp ...
 [ ok ]
 *   Loading w83627ehf ...
 [ !! ]
 * Initializing sensors ...
  [ ok ]
 * Starting nxserver ...
NX> 122 Service started.
NX> 999 Bye.
NX> 723 Cannot start NX statistics:
NX> 709 NX statistics are disabled for this server.
NX> 999 Bye.
 [ ok ]
 * Starting postfix (/etc/postfix) ...
 [ ok ]
 * Use of the opts variable is deprecated and will be
 * removed in the future.
 * Please use extra_commands, extra_started_commands or extra_stopped_commands.
 * samba -> start: smbd ...
 [ ok ]
 * samba -> start: nmbd ...
 [ ok ]
 * Use of the opts variable is deprecated and will be
 * removed in the future.
 * Please use extra_commands, extra_started_commands or extra_stopped_commands.
 * Starting firewall ...
 [ ok ]
 * Doing udev cleanups
 * Starting vixie-cron ...
 [ ok ]
 * Starting local
 [ ok ]

rc default logging stopped at Sun Feb 26 13:38:13 2012
Comment 3 stathis 2012-12-17 11:03:45 UTC
(In reply to comment #1)
> InCVS.


any chance of actually fixing this? As of 2.4.30, net.XX depends on dbus and slapd fails to start.