Can't /.../rc.d/slapd.sh start

Aaron aaron at justaaron.com
Sun Nov 9 12:14:49 PST 2003


I'm at my wit's end.  It was a short trip.

I can start slapd directly, but not from the startup script slapd.sh and 
therefore not automatically at boot.

Starting slapd directly works fine, and I can access the database:
[root at haiku aaron]# ll /usr/local/libexec/slapd
-rwxr-xr-x  1 root  wheel  633748 Nov  1 11:00 /usr/local/libexec/slapd*

Here's my startup script, installed from the port:
[root at haiku aaron]# ll /usr/local/etc/rc.d/slapd.sh
-r-xr-xr-x  1 root  wheel  2472 Nov  1 11:00 usr/local/etc/rc.d/slapd.sh

Here's what I get when I try to start it:
[root at haiku aaron]# /usr/local/etc/rc.d/slapd.sh start
Starting slapd.

However, slapd doesn't show up in "$ sockstat -4"

Here's what I get when I turn on shell debugging:
[root at haiku aaron]# sh -x /usr/local/etc/rc.d/slapd.sh start
... lots and lots of shell execution messages, including this:
+ checkyesno slapd_enable
+ eval _value=$slapd_enable
+ _value=YES
+ debug checkyesno: slapd_enable is set to YES.
+ return 0
+ eval rc_pid=$(check_pidfile /var/run/openldap/slapd.pid 
/usr/local/libexec/slapd )
+ check_pidfile /var/run/openldap/slapd.pid /usr/local/libexec/slapd
+ _pidfile=/var/run/openldap/slapd.pid
+ _procname=/usr/local/libexec/slapd
+ _interpreter=
+ [ -z /var/run/openldap/slapd.pid -o -z /usr/local/libexec/slapd ]
+ [ ! -f /var/run/openldap/slapd.pid ]
+ debug pid file {/var/run/openldap/slapd.pid): not readable.
+ return
...

Note the 2nd to last line that ends in "slapd.pid): not readable. 
(Which, ironically, includes an emoticon frownie-face.)

[root at haiku aaron]# ll /var/run/openldap/slapd.pid
ls: /var/run/openldap/slapd.pid: No such file or directory

Here's the relevant lines from /usr/local/etc/openldap/slapd.conf
pidfile         /var/run/openldap/slapd.pid
argsfile        /var/run/openldap/slapd.args

OK, so I'll create those files:
[root at haiku run]# cd /var/run/openldap/
[root at haiku openldap]# touch slapd.pid slapd.args
[root at haiku openldap]# ll
total 4
drwxr-xr-x  2 ldap  ldap   512 Nov  9 12:34 ./
drwxr-xr-x  6 root  wheel  512 Nov  9 12:06 ../
-rw-r--r--  1 root  ldap     0 Nov  9 12:34 slapd.args
-rw-r--r--  1 root  ldap     0 Nov  9 12:34 slapd.pid

They are owner/group root:ldap, izzat OK or should it be ldap:ldap? 
We'll change it a little later.

Anyway, now that I've touched the pid file, let's start again:

Well, here's progress, or change at least:
[root at haiku openldap]# sh -x /usr/local/etc/rc.d/slapd.sh start
...
+ checkyesno slapd_enable
+ eval _value=$slapd_enable
+ _value=YES
+ debug checkyesno: slapd_enable is set to YES.
+ return 0
+ eval rc_pid=$(check_pidfile /var/run/openldap/slapd.pid 
/usr/local/libexec/slapd )
+ check_pidfile /var/run/openldap/slapd.pid /usr/local/libexec/slapd
+ _pidfile=/var/run/openldap/slapd.pid
+ _procname=/usr/local/libexec/slapd
+ _interpreter=
+ [ -z /var/run/openldap/slapd.pid -o -z /usr/local/libexec/slapd ]
+ [ ! -f /var/run/openldap/slapd.pid ]
+ read _pid _junk
+ [ -z  ]
+ debug pid file {/var/run/openldap/slapd.pid): no pid in file.
+ return
...

Note that now there's "no pid in file," and a couple lines up from that 
it says "read _pid _junk."

At this point I tried chown ldap:ldap slapd.pid, but got exactly the 
same results, junk pid.

Here's my system and port information:

[root at haiku aaron]# uname -a
FreeBSD haiku.krelm.com 4.9-PRERELEASE FreeBSD 4.9-PRERELEASE #1: Sat 
Sep 20 02:41:27 MDT 2003 
aaron at haiku.krelm.com:/usr/src/sys/compile/HAIKU  i386

[root at haiku openldap]# portversion -v |grep ldap
openldap-client-2.1.22      =  up-to-date with port
openldap-server-2.1.22_2    =  up-to-date with port

Open to suggestions.

-- 
Aaron
aaron at justaaron.com



More information about the freebsd-questions mailing list