start slapd automatically

Tim Dunphy bluethundr at gmail.com
Thu Oct 28 16:19:26 UTC 2010


ok thanks.. this is what I tried:

[root at LBSD2:/var/run/openldap]#vi /usr/local/etc/rc.conf

# -- sysinstall generated deltas -- # Sun Aug 15 18:54:08 2010
# Created: Sun Aug 15 18:54:08 2010
# Enable network daemons for user convenience.
# Please make all changes to this file, not to /etc/defaults/rc.conf.
# This file now contains just the overrides from /etc/defaults/rc.conf.
defaultrouter="192.168.1.1"
hostname="LBSD2.summitnjhome.com"
ifconfig_bge0="inet 192.168.1.44  netmask 255.255.255.0"
sshd_enable="YES"
apache22_enable=YES
mysql_enable=YES
hald_enable=YES
dbus_enable=YES
dbus_enable="YES"
hald_enable="YES"
local_startup="{local_startup} /usr/local/kde4/etc/rc.d"
kde4_enable="YES"
named_enable=YES
slapd_enable=YES
slapd_enable="YES"
slapd_flags='-h "ldapi://%2fvar%2frun%2fopenldap%2fldapi/ ldap://192.168.1.44/"'
slapd_sockets="/var/run/openldap/ldapi"
# -- sysinstall generated deltas -- # Thu Sep 16 00:12:09 2010
rpcbind_enable="YES"
nfs_server_enable="YES"
slapd_enable="YES"




[root at LBSD2:/var/run/openldap]#/usr/local/etc/rc.d/slapd restart
Stopping slapd.
Waiting for PIDS: 6701.
Starting slapd.



[root at LBSD2:/var/run/openldap]#lsof -U | grep slapd
slapd   6824       ldap    3u  unix 0xc8950000      0t0      ->0xc46cb19c
slapd   6824       ldap    3u  unix 0xc8950000      0t0      ->0xc46cb19c

[root at LBSD2:/var/run/openldap]#ls -lh /var/run/openldap/
total 8
-rw-r--r--  1 ldap  ldap     0B Oct 28 12:10 ldapi
-rw-r--r--  1 ldap  ldap    42B Oct 28 12:15 slapd.args
-rw-r--r--  1 ldap  ldap     5B Oct 28 12:15 slapd.pid


[root at LBSD2:/var/run/openldap]#cat /var/run/openldap/ldapi


[root at LBSD2:/var/run/openldap]#

I'm not sure why the socket file is empty at the moment..but I have
verified that openLDAP is functioning...I can bounce around the
network easily by logging in as the LDAP users...

can't actually reboot the machine right now, but hopefully this should
work. I'll give a shout the next time I reboot if it doesn't start
slapd as expected.

thanks!


On Thu, Oct 28, 2010 at 11:53 AM, Lowell Gilbert
<freebsd-questions-local at be-well.ilk.org> wrote:
> Tim Dunphy <bluethundr at gmail.com> writes:
>
>    >  I have a quick one for ya.. I am running openLDAP 2.4 server on my
>    > freebsd box and it's coming along nicely.
>    >
>    >  But whenever I reboot the box it doesn't start automatically. What's
>    > the best way to accomplish this?
>    >
>    >  My /etc/defaults/rc.conf has the following entry:
>    >
>    >  local_startup="/usr/local/etc/rc.d" # startup script dirs.
>    >
>    >   And slapd is living in the location referenced on that line:
>    >
>    >
>    > [root at LBSD2:/usr/home/bluethundr]#ls -l /usr/local/etc/rc.d/slapd
>    > -r-xr-xr-x  1 root  wheel  3591 Oct  9 21:37 /usr/local/etc/rc.d/slapd
>    >
>    >
>    >  So I am under the impression that it should be starting there normally.
>
>    You probably missed the rc.conf entry, described in the message that was
>    printed when you installed the port.  Specifically:
>    In order to run the LDAP server, you need to edit
>      %%PREFIX%%/etc/openldap/slapd.conf
>    to suit your needs and add the following lines to /etc/rc.conf:
>      slapd_enable="YES"
>      slapd_flags='-h "ldapi://%2fvar%2frun%2fopenldap%2fldapi/
>      ldap://0.0.0.0/"'
>      slapd_sockets="/var/run/openldap/ldapi"
>
>    Then start the server with
>      %%PREFIX%%/etc/rc.d/slapd start
>    or reboot.
>
> Where %%PREFIX%% is presumably /usr/local.
>
>



-- 
Here's my RSA Public key:
gpg --keyserver pgp.mit.edu --recv-keys 5A4873A9

Share and enjoy!!


More information about the freebsd-questions mailing list