Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 04 Jul 2008 22:34:32 -0400
From:      Mikhail Goriachev <mikhailg@webanoide.org>
To:        Peter Pentchev <roam@ringlet.net>, delphij@FreeBSD.org, ports@FreeBSD.org
Subject:   Re: FreeBSD Port: openldap-server-2.4.10
Message-ID:  <20080704223432.49566vn60rygljk8@www.san.navalradio.cl>
In-Reply-To: <20080704221500.GA1118@straylight.m.ringlet.net>
References:  <20080704132215.36754y85s8y8kisk@www.san.navalradio.cl> <20080704221500.GA1118@straylight.m.ringlet.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Quoting Peter Pentchev <roam@ringlet.net>:

> On Fri, Jul 04, 2008 at 01:22:15PM -0400, Mikhail Goriachev wrote:
>> Hi,
> [snip]
>> I slapped together a workaround. Here's a "patch", maybe the idea of
>> it will be of some use.
>
> Just a minor comment on the patch:
>
>> +DBDIR=3D`grep directory /usr/local/etc/openldap/slapd.conf | awk '{
>> print $2 }'`
>
> This is better written as
>
>   awk '/directory/ {print $2}' /usr/local/etc/openldap/slapd.conf


Nice one!


>
> or possibly (I'm not quite familiar with the slapd.conf syntax) even:
>
>   awk '$1 =3D=3D "directory" {print $2}' /usr/local/etc/openldap/slapd.con=
f


They both work but I like the first one more.


> Then there's another thing - it might be better to make this depend on
> the actual prefix where the OpenLDAP server is installed (it is not
> necessarily /usr/local), but that's a whole different can of beer that
> I'm not familiar with, since I don't even have an OpenLDAP server
> installed on my system :)


Thanks for that. Here's a "proper" working patch.


--- slapd.sh.in.original        2008-07-05 01:38:52.000000000 +0000
+++ slapd.sh.in 2008-07-05 01:44:33.000000000 +0000
@@ -39,6 +39,8 @@

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

+DBDIR=3D`awk '/directory/ {print $2}' %%PREFIX%%/etc/openldap/slapd.conf`
+
  start_precmd()
  {
    local slapd_ownername slapd_groupname
@@ -48,8 +50,8 @@
      ;;
    *)
      chown "$slapd_owner" "%%LDAP_RUN_DIR%%"
-    chown -RL "$slapd_owner" "%%DATABASEDIR%%"
-    chmod 700 "%%DATABASEDIR%%"
+    chown -RL "$slapd_owner" "${DBDIR}"
+    chmod 700 "${DBDIR}"
      chown "$slapd_owner" "%%PREFIX%%/etc/openldap/slapd.conf"

      slapd_ownername=3D"${slapd_owner%:*}"




Regards,
Mikhail.

--=20
Mikhail Goriachev
Webanoide




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