cvs commit: ports/net/nss-pam-ldapd Makefile pkg-descr ports/net/nss-pam-ldapd/files nslcd.in

Doug Barton dougb at FreeBSD.org
Tue Dec 6 01:52:09 UTC 2011


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 at 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/

-------------- next part --------------
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"


More information about the cvs-all mailing list