FreeBSD Port: openldap-server-2.4.10

Mikhail Goriachev mikhailg at webanoide.org
Fri Jul 4 17:57:33 UTC 2008


Hi,

Due to our requirement, the database directory of the openldap-server  
has been relocated from its default /var/db/openldap-data. However,  
the daemon script /usr/local/etc/rc.d/slapd doesn't use the  
"directory" entry from slapd.conf.

When executed, it throws:

chown: /var/db/openldap-data: No such file or directory
chmod: /var/db/openldap-data: No such file or directory

I slapped together a workaround. Here's a "patch", maybe the idea of  
it will be of some use.

Thanks for your time.





--- slapd.original	2008-07-04 16:35:31.000000000 +0000
+++ slapd	2008-07-04 16:50:08.000000000 +0000
@@ -39,6 +39,8 @@

  # extract user and group, adjust ownership of directories and database

+DBDIR=`grep directory /usr/local/etc/openldap/slapd.conf | awk '{  
print $2 }'`
+
  start_precmd()
  {
    local slapd_ownername slapd_groupname
@@ -48,8 +50,8 @@
      ;;
    *)
      chown "$slapd_owner" "/var/run/openldap"
-    chown -RL "$slapd_owner" "/var/db/openldap-data"
-    chmod 700 "/var/db/openldap-data"
+    chown -RL "$slapd_owner" "${DBDIR}"
+    chmod 700 "${DBDIR}"
      chown "$slapd_owner" "/usr/local/etc/openldap/slapd.conf"

      slapd_ownername="${slapd_owner%:*}"







Regards,
Mikhail.

-- 
Mikhail Goriachev
Webanoide



More information about the freebsd-ports mailing list