Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Dec 2009 11:33:23 GMT
From:      Filip Palian <admin@expro.pl>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/141890: The slapd server starts/restarts way too long - chckien and egg problem
Message-ID:  <200912221133.nBMBXNQN086049@www.freebsd.org>
Resent-Message-ID: <200912221140.nBMBe8mm098932@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         141890
>Category:       misc
>Synopsis:       The slapd server starts/restarts way too long - chckien and egg problem
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Dec 22 11:40:08 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Filip Palian
>Release:        8.0-RELEASE
>Organization:
Expro Sp. z o.o.
>Environment:
reeBSD <hostname> 8.0-RELEASE FreeBSD 8.0-RELEASE #2: Tue Dec  1 13:43:39 CET 2009     root@<hostname>:/usr/obj/usr/src/sys/<hostname>  amd64
>Description:
The slapd server (and other services) on system boot or on restart takes ages to run, because it waits to query itself. This situation takes place when the system uses pam_ldap, nss_ldap and when nsswitch.conf is configured to query LDAP database.
>How-To-Repeat:
1) install and configure OpenLDAP server, pam_ldap and nss_ldap
2) reboot your system
>Fix:
Dirty fix for this problem is to apply the attached patch on "/usr/local/etc/rc.d/slapd". To make this work you also need to create "nsswitch.conf.ldap" and "nsswitch.conf.noldap" in "/etc" directory with the following content:

nsswitch.conf.ldap:
 group: files ldap
 group_compat: nis
 hosts:	files dns
 networks: files
 passwd: files ldap
 passwd_compat: nis
 shells: files
 services: compat
 services_compat: nis
 protocols: files
 rpc: files

nsswitch.conf.noldap:
 group: files
 group_compat: nis
 hosts:	files dns
 networks: files
 passwd: files
 passwd_compat: nis
 shells: files
 services: compat
 services_compat: nis
 protocols: files
 rpc: files


Credits goes to Eric Masson (http://markmail.org/message/ecc6orwz43bkk5ib).

Patch attached with submission follows:

--- slapd.bak	2009-12-02 13:59:32.000000000 +0100
+++ slapd	2009-12-18 15:40:51.000000000 +0100
@@ -110,6 +110,8 @@ start_precmd()
     fi
     ;;
   esac
+
+  cp /etc/nsswitch.conf.noldap /etc/nsswitch.conf
 }
 
 # adjust ownership of created unix sockets
@@ -136,6 +138,8 @@ start_postcmd()
       warn "slapd: Can't find socket $socket"
     fi
   done
+
+  cp /etc/nsswitch.conf.ldap /etc/nsswitch.conf
 }
 
 run_rc_command "$1"


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200912221133.nBMBXNQN086049>