From owner-cvs-all@FreeBSD.ORG Sun Sep 25 06:33:57 2011 Return-Path: Delivered-To: cvs-all@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id C103A1065672; Sun, 25 Sep 2011 06:33:57 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-198-245.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 6C930153D9D; Sun, 25 Sep 2011 06:33:57 +0000 (UTC) Message-ID: <4E7ECB54.5020400@FreeBSD.org> Date: Sat, 24 Sep 2011 23:33:56 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:6.0.2) Gecko/20110912 Thunderbird/6.0.2 MIME-Version: 1.0 To: Sergey Matveychuk References: <201109151259.p8FCxnqe071780@repoman.freebsd.org> In-Reply-To: <201109151259.p8FCxnqe071780@repoman.freebsd.org> X-Enigmail-Version: undefined OpenPGP: id=1A1ABC84 Content-Type: multipart/mixed; boundary="------------020200090403070504080201" 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 X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Sep 2011 06:33:57 -0000 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 -.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 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--