Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Sep 2011 23:33:56 -0700
From:      Doug Barton <dougb@FreeBSD.org>
To:        Sergey Matveychuk <sem@FreeBSD.org>
Cc:        cvs-ports@FreeBSD.org, melifaro@ipfw.ru, cvs-all@FreeBSD.org, ports-committers@FreeBSD.org
Subject:   Re: cvs commit: ports/net/nss-pam-ldapd Makefile ports/net/nss-pam-ldapd/files nslcd.in
Message-ID:  <4E7ECB54.5020400@FreeBSD.org>
In-Reply-To: <201109151259.p8FCxnqe071780@repoman.freebsd.org>
References:  <201109151259.p8FCxnqe071780@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------020200090403070504080201
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Attached are some improvements to this port. For the rc.d script there
are 2 main problems. There is a literal /usr/local, and the loop for
waiting for the daemon to start shouldn't last forever. If you think
that a value longer than 10 seconds is a reasonable default that's fine,
but forever isn't done.

I also moved the message to a pkg-message file so that it can be seen by
package installations as well. The variable bits could be reconstructed
by using files/pkg-message.in and some more complex gymnastics in the
Makefile if that's desired instead.


Doug


On 09/15/2011 05:59, Sergey Matveychuk wrote:
> sem         2011-09-15 12:59:49 UTC
> 
>   FreeBSD ports repository
> 
>   Modified files:
>     net/nss-pam-ldapd    Makefile 
>     net/nss-pam-ldapd/files nslcd.in 
>   Log:
>   - Run nslcd before syslogd as we use external group present in syslog.conf,
>     and it should be resolvable when syslogd starts. Remove DAEMON from
>     dependency list to fix circular dependency problem.
>   - Ensure nslcd is usable right after it was started.
>   
>   Submitted by:   maintainer
>   
>   Revision  Changes    Path
>   1.10      +1 -1      ports/net/nss-pam-ldapd/Makefile
>   1.5       +12 -2     ports/net/nss-pam-ldapd/files/nslcd.in
> 
> http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/net/nss-pam-ldapd/Makefile.diff?&r1=1.9&r2=1.10&f=h
> http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/net/nss-pam-ldapd/files/nslcd.in.diff?&r1=1.4&r2=1.5&f=h
> 



-- 

	Nothin' ever doesn't change, but nothin' changes much.
			-- OK Go

	Breadth of IT experience, and depth of knowledge in the DNS.
	Yours for the right price.  :)  http://SupersetSolutions.com/


--------------020200090403070504080201
Content-Type: text/plain;
 name="nss-pam-ldapd.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="nss-pam-ldapd.diff"

Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/net/nss-pam-ldapd/Makefile,v
retrieving revision 1.11
diff -u -r1.11 Makefile
--- Makefile	23 Sep 2011 22:24:33 -0000	1.11
+++ Makefile	25 Sep 2011 06:29:53 -0000
@@ -7,7 +7,7 @@
 
 PORTNAME=		nss-pam-ldapd
 PORTVERSION=		0.7.13
-PORTREVISION=		2
+PORTREVISION=		3
 CATEGORIES=		net
 MASTER_SITES=		http://arthurdejong.org/nss-pam-ldapd/ \
 			http://static.ipfw.ru/files/
@@ -33,10 +33,6 @@
 
 .include <bsd.port.pre.mk>
 
-.if ${OSVERSION} < 700000
-IGNORE=			problems with nss/libc TLS
-.endif
-
 .if ${OSVERSION} < 800000
 EXTRA_PATCHES+=		${FILESDIR}/rtld_nss__nslcd.c
 .endif
@@ -98,18 +94,6 @@
 	${REINPLACE_CMD} -e 's/^\(CFLAGS.*\) \-O2 \(.*\)$$/\1 -O0 \2/' ${WRKSRC}/nss/Makefile
 
 post-install:
-	@${ECHO_MSG}
-	@${ECHO_MSG} =====================================================================
-	@${ECHO_MSG}
-	@${ECHO_MSG} " LDAP configuration:      ${PREFIX}/etc/${CONFIG_FILE}"
-	@${ECHO_MSG} " Sample configuration:    ${PREFIX}/etc/${CONFIG_FILE}.sample"
-	@${ECHO_MSG}
-.if !defined(WITHOUT_NSS)
-	@${ECHO_MSG} " WARNING: Be sure to set uid and gid configuration parameters"
-	@${ECHO_MSG} " WARNING: to make nslcd run under unprivileged user"
-.endif
-	@${ECHO_MSG}
-	@${ECHO_MSG} =====================================================================
-	@${ECHO_MSG}
+	@${CAT} ${PKGMESSAGE}
 
 .include <bsd.port.post.mk>
Index: pkg-message
===================================================================
RCS file: pkg-message
diff -N pkg-message
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ pkg-message	25 Sep 2011 06:29:53 -0000
@@ -0,0 +1,10 @@
+=====================================================================
+
+ LDAP configuration:      /usr/local/etc/nslcd.conf
+ Sample configuration:    /usr/local/etc/nslcd.conf.sample
+
+ If you chose the WITHOUT_NSS option:
+ WARNING: Be sure to set uid and gid configuration parameters
+ WARNING: to make nslcd run under unprivileged user
+
+=====================================================================
Index: files/nslcd.in
===================================================================
RCS file: /home/pcvs/ports/net/nss-pam-ldapd/files/nslcd.in,v
retrieving revision 1.5
diff -u -r1.5 nslcd.in
--- files/nslcd.in	15 Sep 2011 12:59:49 -0000	1.5
+++ files/nslcd.in	25 Sep 2011 06:29:53 -0000
@@ -1,6 +1,6 @@
 #!/bin/sh
-#
-# $FreeBSD: ports/net/nss-pam-ldapd/files/nslcd.in,v 1.5 2011/09/15 12:59:49 sem Exp $
+
+# $FreeBSD
 #
 # PROVIDE: nslcd
 # REQUIRE: ldconfig resolv
@@ -9,26 +9,32 @@
 # Add the following line to /etc/rc.conf to enable the nslcd daemon:
 #
 # nslcd_enable="YES"
-#
-
-nslcd_enable=${nslcd_enable-"NO"}
 
 . /etc/rc.subr
 
 name=nslcd
 rcvar=$(set_rcvar)
 
-start_postcmd="nslcd_poststart"
+load_rc_config ${name}
 
-nslcd_poststart () {
-       until $(/usr/local/sbin/nslcd -c); do
-               echo " Waiting for nslcd to start"
-               sleep 1
-       done
-}
+nslcd_enable=${nslcd_enable:-"NO"}
 
 command="%%PREFIX%%/sbin/${name}"
 pidfile="/var/run/${name}.pid"
 
-load_rc_config ${name}
+start_postcmd="nslcd_poststart"
+
+nslcd_poststart ()
+{
+	local i
+
+	i=0
+	until $(%%PREFIX%%/sbin/nslcd -c); do
+		i=$(( $i + 1 ))
+		[ $i -gt 10 ] && err 1 "nslcd failed to start"
+		echo " Waiting for nslcd to start"
+		sleep 1
+	done
+}
+
 run_rc_command "$1"

--------------020200090403070504080201--



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