Re: FreeBSD Port: openldap-server-2.4.10
Xin LI wrote: [...] I have committed these changes as part of OpenLDAP 2.4.11, thanks for your submission! A line that isn't supposed to exist is still present in 2.4.11. When compiling from ports the DATABASEDIR is still created. The line: @-$(INSTALL) -m 700 -d $(DESTDIR)$(localstatedir)/openldap-data The working patch: --- patch-servers::slapd::Makefile.in.orig 2008-07-22 19:29:17.0 + +++ patch-servers::slapd::Makefile.in 2008-07-22 19:34:37.0 + @@ -1,5 +1,5 @@ servers/slapd/Makefile.in.orig 2008-02-11 15:26:43.0 -0800 -+++ servers/slapd/Makefile.in 2008-07-19 20:10:16.023473779 -0700 +--- servers/slapd/Makefile.in.orig 2008-02-11 23:26:43.0 + servers/slapd/Makefile.in 2008-07-22 19:25:03.0 + @@ -374,7 +374,6 @@ install-slapd: FORCE @@ -33,12 +33,13 @@ done install-conf: FORCE -@@ -432,8 +433,6 @@ +@@ -430,9 +431,6 @@ + + install-db-config: FORCE @-$(MKDIR) $(DESTDIR)$(localstatedir) $(DESTDIR)$(sysconfdir) - @-$(INSTALL) -m 700 -d $(DESTDIR)$(localstatedir)/openldap-data - $(INSTALL) $(INSTALLFLAGS) -m 600 $(srcdir)/DB_CONFIG \ -- $(DESTDIR)$(localstatedir)/openldap-data/DB_CONFIG.example +- @-$(INSTALL) -m 700 -d $(DESTDIR)$(localstatedir)/openldap-data - $(INSTALL) $(INSTALLFLAGS) -m 600 $(srcdir)/DB_CONFIG \ +- $(DESTDIR)$(localstatedir)/openldap-data/DB_CONFIG.example + $(INSTALL) $(INSTALLFLAGS) -m 600 $(srcdir)/DB_CONFIG \ $(DESTDIR)$(sysconfdir)/DB_CONFIG.example - install-tools: FORCE Once again, thanks! Regards, Mikhail. -- Mikhail Goriachev Webanoide ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: FreeBSD Port: openldap-server-2.4.10
Xin LI wrote: [...] I have committed these changes as part of OpenLDAP 2.4.11, thanks for your submission! Thank you! Regards, Mikhail. -- Mikhail Goriachev Webanoide ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: FreeBSD Port: openldap-server-2.4.10
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Mikhail Goriachev wrote: | Quoting Xin LI [EMAIL PROTECTED]: | | I have just committed it as openldap-server-2.4.10_1. We may want to | revise the way we handle DATABASEDIR, which we used to create | automatically upon installation. Using values from configuration file | would be definitely better, thanks for your submission! | | Thanks a lot for that! | | I revised a few things in regard with the DATABASEDIR which led to some | modifications. It goes like this: | | 1.- When installing from ports, the DATABASEDIR will be always created | no matter what the pkg-plist says. However, when installing a packaged | version, then it is possible to control the creation of the directory. | | Patch for patch-servers::slapd::Makefile.in disables the automatic | installation of the DATABASEDIR and makes installation from ports and | package consistent with one another. | | 2.- Since automatic creation of the DATABASEDIR has been disabled, then | the slapd script uses the value of directory from slapd.conf, creates | the folder, populates it (puts DB_CONFIG) and starts slap daemon. | | Patch for slapd.sh.in automatically handles the DATABASEDIR from the | directory entry located in slapd.conf. Also it quenches the following | error by placing DB_CONFIG: | | bdb_db_open: warning - no DB_CONFIG file found in directory | /var/db/openldap-data: (2). Expect poor performance for suffix | dc=my-domain,dc=com. | | 3.- When un-installing, a message is shown about deleting the database | permanently and an example of the rm command is displayed. | | Patch for pkg-deinstall.in detects if alternative or default | DATABASEDIR is active, formats and displays the message accordingly. | | 4.- After above modifications, there's no need of creating and removing | automatically the DATABASEDIR. | | Patch for pkg-plist disables the creation and deletion of the | DATABASEDIR. I have committed these changes as part of OpenLDAP 2.4.11, thanks for your submission! - -- Xin LI [EMAIL PROTECTED]http://www.delphij.net/ FreeBSD - The Power to Serve! -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.9 (FreeBSD) iEYEARECAAYFAkiCstEACgkQi+vbBBjt66AfugCgghzVsDRpsAjgzQTD+mhCF5MF 9QoAmgO1/ed8fnXKsOh/T5YzLWwNAiHJ =g39l -END PGP SIGNATURE- ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: FreeBSD Port: openldap-server-2.4.10
Quoting Xin LI [EMAIL PROTECTED]: I have just committed it as openldap-server-2.4.10_1. We may want to revise the way we handle DATABASEDIR, which we used to create automatically upon installation. Using values from configuration file would be definitely better, thanks for your submission! Thanks a lot for that! I revised a few things in regard with the DATABASEDIR which led to some modifications. It goes like this: 1.- When installing from ports, the DATABASEDIR will be always created no matter what the pkg-plist says. However, when installing a packaged version, then it is possible to control the creation of the directory. Patch for patch-servers::slapd::Makefile.in disables the automatic installation of the DATABASEDIR and makes installation from ports and package consistent with one another. 2.- Since automatic creation of the DATABASEDIR has been disabled, then the slapd script uses the value of directory from slapd.conf, creates the folder, populates it (puts DB_CONFIG) and starts slap daemon. Patch for slapd.sh.in automatically handles the DATABASEDIR from the directory entry located in slapd.conf. Also it quenches the following error by placing DB_CONFIG: bdb_db_open: warning - no DB_CONFIG file found in directory /var/db/openldap-data: (2). Expect poor performance for suffix dc=my-domain,dc=com. 3.- When un-installing, a message is shown about deleting the database permanently and an example of the rm command is displayed. Patch for pkg-deinstall.in detects if alternative or default DATABASEDIR is active, formats and displays the message accordingly. 4.- After above modifications, there's no need of creating and removing automatically the DATABASEDIR. Patch for pkg-plist disables the creation and deletion of the DATABASEDIR. Patches: --- patch-servers::slapd::Makefile.in.orig 2005-09-15 11:47:23.0 + +++ patch-servers::slapd::Makefile.in 2008-07-10 15:57:34.0 + @@ -1,6 +1,6 @@ servers/slapd/Makefile.in.orig Fri Sep 2 00:28:10 2005 -+++ servers/slapd/Makefile.in Sun Sep 4 17:34:37 2005 -@@ -372,7 +372,6 @@ +--- servers/slapd/Makefile.in.orig 2008-02-11 23:26:43.0 + servers/slapd/Makefile.in 2008-07-10 12:47:36.0 + +@@ -374,7 +374,6 @@ install-slapd: FORCE -$(MKDIR) $(DESTDIR)$(libexecdir) @@ -8,7 +8,7 @@ $(LTINSTALL) $(INSTALLFLAGS) $(STRIP) -m 755 \ slapd$(EXEEXT) $(DESTDIR)$(libexecdir) @for i in $(SUBDIRS); do \ -@@ -403,16 +402,18 @@ +@@ -405,16 +404,18 @@ touch all-cffiles install-schema: FORCE @@ -21,22 +21,23 @@ @SD=$(DESTDIR)$(schemadir) ; \ - files=`cd $(srcdir)/schema ; echo README *.ldif *.schema` ; \ + files=`cd $(srcdir)/schema ; echo README *.ldif` ; \ -+ for i in $$files ; do \ -+ echo $(INSTALL) $(INSTALLFLAGS) -m 444 schema/$$i $$SD/$$i ; \ -+ $(INSTALL) $(INSTALLFLAGS) -m 444 $(srcdir)/schema/$$i $$SD/$$i ; \ -+ done ; \ -+ files=`cd $(srcdir)/schema ; echo *.schema` ; \ for i in $$files ; do \ echo $(INSTALL) $(INSTALLFLAGS) -m 444 schema/$$i $$SD/$$i ; \ $(INSTALL) $(INSTALLFLAGS) -m 444 $(srcdir)/schema/$$i $$SD/$$i ; \ ++ done ; \ ++ files=`cd $(srcdir)/schema ; echo *.schema` ; \ ++ for i in $$files ; do \ ++ echo $(INSTALL) $(INSTALLFLAGS) -m 444 schema/$$i $$SD/$$i ; \ ++ $(INSTALL) $(INSTALLFLAGS) -m 444 $(srcdir)/schema/$$i $$SD/$$i ; \ + $(INSTALL) $(INSTALLFLAGS) -m 444 $(srcdir)/schema/$$i $$SD/$$i.default ; \ done install-conf: FORCE -@@ -429,8 +430,6 @@ +@@ -430,9 +431,6 @@ + install-db-config: FORCE @-$(MKDIR) $(DESTDIR)$(localstatedir) $(DESTDIR)$(sysconfdir) - @-$(INSTALL) -m 700 -d $(DESTDIR)$(localstatedir)/openldap-data +- @-$(INSTALL) -m 700 -d $(DESTDIR)$(localstatedir)/openldap-data - $(INSTALL) $(INSTALLFLAGS) -m 600 $(srcdir)/DB_CONFIG \ - $(DESTDIR)$(localstatedir)/openldap-data/DB_CONFIG.example $(INSTALL) $(INSTALLFLAGS) -m 600 $(srcdir)/DB_CONFIG \ --- slapd.sh.in.orig2008-07-07 20:54:21.0 + +++ slapd.sh.in 2008-07-10 15:57:51.0 + @@ -49,6 +49,10 @@ |[Nn][Oo][Nn][Ee]|[Dd][Ee][Ff][Aa][Uu][Ll][Tt]) ;; *) +if [ ! -d ${DBDIR} ]; then + mkdir -p ${DBDIR} + cp %%PREFIX%%/etc/openldap/DB_CONFIG.example ${DBDIR}/DB_CONFIG +fi chown $slapd_owner %%LDAP_RUN_DIR%% chown -RL $slapd_owner ${DBDIR} chmod 700 ${DBDIR} --- pkg-deinstall.in.orig 2007-09-05 06:37:13.0 + +++ pkg-deinstall.in2008-07-10 16:54:29.0 + @@ -5,6 +5,10 @@ ECHO_CMD=echo +if [ -f %%PREFIX%%/etc/openldap/slapd.conf ]; then + DBDIR=`awk '$1 == directory {print $2}' %%PREFIX%%/etc/openldap/slapd.conf` +fi + case $2 in POST-DEINSTALL) ${ECHO_CMD} @@ -13,9 +17,13 @@
Re: FreeBSD Port: openldap-server-2.4.10
Quoting Peter Pentchev [EMAIL PROTECTED]: On Fri, Jul 04, 2008 at 10:34:32PM -0400, Mikhail Goriachev wrote: Quoting Peter Pentchev [EMAIL PROTECTED]: 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=`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 == directory {print $2}' /usr/local/etc/openldap/slapd.conf They both work but I like the first one more. Actually the second one might be better - the first one may be confused by the string directory appearing either in a comment or in the string value of some other parameter or even in the *name* of some other parameter. Oh, didn't really see the meaning of the second line before. Thanks a lot for that. And the patch goes again: --- slapd.sh.in.orig2008-07-05 18:47:30.0 + +++ slapd.sh.in 2008-07-05 18:53:00.0 + @@ -39,6 +39,8 @@ # extract user and group, adjust ownership of directories and database +DBDIR=`awk '$1 == 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=${slapd_owner%:*} Regards, Mikhail. -- Mikhail Goriachev Webanoide ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: FreeBSD Port: openldap-server-2.4.10
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, Mikhail Goriachev wrote: [...] | Actually the second one might be better - the first one may be confused | by the string directory appearing either in a comment or in the string | value of some other parameter or even in the *name* of some other | parameter. | | | Oh, didn't really see the meaning of the second line before. Thanks a | lot for that. I have just committed it as openldap-server-2.4.10_1. We may want to revise the way we handle DATABASEDIR, which we used to create automatically upon installation. Using values from configuration file would be definitely better, thanks for your submission! Cheers, - -- Xin LI [EMAIL PROTECTED]http://www.delphij.net/ FreeBSD - The Power to Serve! -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.9 (FreeBSD) iEYEARECAAYFAkhygvgACgkQi+vbBBjt66CxzQCcCXMYfH4RwNZgSs4pHogRsMc3 ZIkAoICZUTo8BJIwjDw+oq/yrgOdwO3q =walv -END PGP SIGNATURE- ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: FreeBSD Port: openldap-server-2.4.10
On Fri, Jul 04, 2008 at 10:34:32PM -0400, Mikhail Goriachev wrote: Quoting Peter Pentchev [EMAIL PROTECTED]: 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=`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 == directory {print $2}' /usr/local/etc/openldap/slapd.conf They both work but I like the first one more. Actually the second one might be better - the first one may be confused by the string directory appearing either in a comment or in the string value of some other parameter or even in the *name* of some other parameter. G'luck, Peter -- Peter Pentchev [EMAIL PROTECTED][EMAIL PROTECTED][EMAIL PROTECTED] PGP key:http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553 This sentence was in the past tense. pgpO1jGnVO9tD.pgp Description: PGP signature
FreeBSD Port: openldap-server-2.4.10
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.0 + +++ slapd 2008-07-04 16:50:08.0 + @@ -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 ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: FreeBSD Port: openldap-server-2.4.10
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=`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 or possibly (I'm not quite familiar with the slapd.conf syntax) even: awk '$1 == directory {print $2}' /usr/local/etc/openldap/slapd.conf 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 :) G'luck, Peter -- Peter Pentchev [EMAIL PROTECTED][EMAIL PROTECTED][EMAIL PROTECTED] PGP key:http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553 This sentence is false. pgpb8FQ50dCeY.pgp Description: PGP signature
Re: FreeBSD Port: openldap-server-2.4.10
Quoting Peter Pentchev [EMAIL PROTECTED]: 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=`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 == directory {print $2}' /usr/local/etc/openldap/slapd.conf 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.original2008-07-05 01:38:52.0 + +++ slapd.sh.in 2008-07-05 01:44:33.0 + @@ -39,6 +39,8 @@ # extract user and group, adjust ownership of directories and database +DBDIR=`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=${slapd_owner%:*} Regards, Mikhail. -- Mikhail Goriachev Webanoide ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to [EMAIL PROTECTED]