Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 05 Dec 2011 17:51:22 -0800
From:      Doug Barton <dougb@FreeBSD.org>
To:        Ryan Steinmetz <zi@FreeBSD.org>
Cc:        cvs-ports@FreeBSD.org, cvs-all@FreeBSD.org, ports-committers@FreeBSD.org
Subject:   Re: cvs commit: ports/net/nss-pam-ldapd Makefile pkg-descr ports/net/nss-pam-ldapd/files nslcd.in
Message-ID:  <4EDD751A.3070204@FreeBSD.org>
In-Reply-To: <201111072233.pA7MXsWP062580@repoman.freebsd.org>
References:  <201111072233.pA7MXsWP062580@repoman.freebsd.org>

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

A few notes on the rc.d script:

1. Various style issues, corrected in the attached patch.
2. The "Did I start?" test needs a terminating condition, we don't want
the boot to hang forever. I'd do it like the attached, but I wouldn't
object to any other method that works. (I also don't care how many
actual seconds it waits, I just picked 10 at pseudo-random)

One question, why is it necessary for this service to start so early?


hth,

Doug

On 11/07/2011 14:33, Ryan Steinmetz wrote:
> zi          2011-11-07 22:33:54 UTC
> 
>   FreeBSD ports repository
> 
>   Modified files:
>     net/nss-pam-ldapd    Makefile pkg-descr 
>     net/nss-pam-ldapd/files nslcd.in 
>   Log:
>   - Honor custom PREFIX [1]
>   - Remove 6.x support
>   - Pacify portlint(1)
>   
>   PR:             ports/161689  http://www.FreeBSD.org/cgi/query-pr.cgi?pr=161689
>   Submitted by:   Andrew Kolchoogin <gadm@web.trunk-com.ru> [1]
>   Approved by:    maintainer timeout (2+ weeks)
>   
>   Revision  Changes    Path
>   1.12      +3 -7      ports/net/nss-pam-ldapd/Makefile
>   1.6       +2 -2      ports/net/nss-pam-ldapd/files/nslcd.in
>   1.3       +8 -6      ports/net/nss-pam-ldapd/pkg-descr
> 
> http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/net/nss-pam-ldapd/Makefile.diff?&r1=1.11&r2=1.12&f=h
> http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/net/nss-pam-ldapd/files/nslcd.in.diff?&r1=1.5&r2=1.6&f=h
> http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/net/nss-pam-ldapd/pkg-descr.diff?&r1=1.2&r2=1.3&f=h
> 



-- 

		[^L]

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


--------------050506050100070308060706
Content-Type: text/plain;
 name="nslcd-rcd.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="nslcd-rcd.diff"

Index: nslcd.in
===================================================================
RCS file: /home/pcvs/ports/net/nss-pam-ldapd/files/nslcd.in,v
retrieving revision 1.6
diff -u -r1.6 nslcd.in
--- nslcd.in	7 Nov 2011 22:33:54 -0000	1.6
+++ nslcd.in	6 Dec 2011 01:49:06 -0000
@@ -1,34 +1,43 @@
 #!/bin/sh
-#
+
 # $FreeBSD: ports/net/nss-pam-ldapd/files/nslcd.in,v 1.6 2011/11/07 22:33:54 zi Exp $
 #
 # PROVIDE: nslcd
 # REQUIRE: ldconfig resolv
 # BEFORE: syslogd
+# KEYWORD: shutdown
 #
 # 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 $(%%PREFIX%%/sbin/${name} -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
+
+	echo ' Waiting for nslcd to start'
+
+	i=0
+	while [ $i -lt 10 ] ; do
+		%%PREFIX%%/sbin/${name} -c && return
+		sleep 1
+		i=$(( $i + 1 ))
+	done
+
+	err 1 "$name failed to start"
+}
+
 run_rc_command "$1"

--------------050506050100070308060706--



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