From owner-freebsd-ports@FreeBSD.ORG Fri Dec 2 20:32:34 2005 Return-Path: X-Original-To: freebsd-ports@FreeBSD.org Delivered-To: freebsd-ports@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 29A5E16A41F for ; Fri, 2 Dec 2005 20:32:34 +0000 (GMT) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mail2.fluidhosting.com [204.14.90.12]) by mx1.FreeBSD.org (Postfix) with SMTP id 4817F43D58 for ; Fri, 2 Dec 2005 20:32:10 +0000 (GMT) (envelope-from dougb@FreeBSD.org) Received: (qmail 29957 invoked by uid 399); 2 Dec 2005 20:32:01 -0000 Received: from localhost (HELO ?192.168.0.5?) (dougb@dougbarton.us@127.0.0.1) by localhost with SMTP; 2 Dec 2005 20:32:01 -0000 Message-ID: <4390AF40.1060600@FreeBSD.org> Date: Fri, 02 Dec 2005 12:32:00 -0800 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051106) X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-ports@FreeBSD.org, oli@isnic.is X-Enigmail-Version: 0.93.0.0 Content-Type: multipart/mixed; boundary="------------090909020408020907030101" Cc: Subject: HEADS UP: local_startup scripts in the base rcorder for HEAD X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2005 20:32:34 -0000 This is a multi-part message in MIME format. --------------090909020408020907030101 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Howdy, The change I warned about the other day has now been made in HEAD. I've attached a patch that provides an example of how to convert a port (in this case nsd), to take advantage of the new system. The rc.subr system treats scripts named foo.sh differently than scripts named foo. The former are actually sourced into the rc environment, which can cause problems if there are errors in the script, it overwrites a global variable used elsewhere, etc. Thus, it is better to install the script as foo instead of foo.sh. The other thing that you'll need to be aware of is that as of now the scripts that contain the PROVIDE keyword will be run in rcorder order, instead of always being run as part of rc.d/localpkg. In most cases, that means that they will be run after LOGIN. Including these scripts in the overall rcorder means that you now have the opportunity to specify with greater accuracy where you would like them to run (as long as it is after mountcritremote). If you need any help with this, please feel free to write to the freebsd-rc@freebsd.org list. Once most of the bogons have been shaken out with this change in HEAD, I plan to MFC it to RELENG_6 ASAP, definitely before 6.1-RELEASE. So, we need your help to try and update these scripts as soon as possible as well. Good luck, :) Doug -------- Original Message -------- Subject: cvs commit: src/etc rc rc.shutdown rc.subr src/etc/rc.d localpkg src/sys/sys param.h Date: Fri, 2 Dec 2005 20:06:07 +0000 (UTC) From: Doug Barton To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org dougb 2005-12-02 20:06:07 UTC FreeBSD src repository Modified files: etc rc rc.shutdown rc.subr etc/rc.d localpkg sys/sys param.h Log: Introduce startup scripts from the local_startup directories to the base rcorder. This is accomplished by running rcorder twice, first to get all the disks mounted (through mountcritremote), then again to include the local_startup directories. This dramatically changes the behavior of rc.d/localpkg, as all "local" scripts that have the new rc.d semantics are now run in the base rcorder, so only scripts that have not been converted yet will run in rc.d/localpkg. Make a similar change in rc.shutdown, and add some functions in rc.subr to support these changes. Bump __FreeBSD_version to reflect this change. Revision Changes Path 1.337 +33 -1 src/etc/rc 1.7 +5 -32 src/etc/rc.d/localpkg 1.31 +7 -1 src/etc/rc.shutdown 1.44 +38 -0 src/etc/rc.subr 1.254 +1 -1 src/sys/sys/param.h http://www.FreeBSD.org/cgi/cvsweb.cgi/src/etc/rc.diff?&r1=1.336&r2=1.337&f=h http://www.FreeBSD.org/cgi/cvsweb.cgi/src/etc/rc.d/localpkg.diff?&r1=1.6&r2=1.7&f=h http://www.FreeBSD.org/cgi/cvsweb.cgi/src/etc/rc.shutdown.diff?&r1=1.30&r2=1.31&f=h http://www.FreeBSD.org/cgi/cvsweb.cgi/src/etc/rc.subr.diff?&r1=1.43&r2=1.44&f=h http://www.FreeBSD.org/cgi/cvsweb.cgi/src/sys/sys/param.h.diff?&r1=1.253&r2=1.254&f=h --------------090909020408020907030101 Content-Type: text/plain; name="nsd-rc-local.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="nsd-rc-local.diff" Index: Makefile =================================================================== RCS file: /home/pcvs/ports/dns/nsd/Makefile,v retrieving revision 1.26 diff -u -r1.26 Makefile --- Makefile 6 Sep 2005 16:26:40 -0000 1.26 +++ Makefile 2 Dec 2005 07:27:50 -0000 @@ -42,6 +42,16 @@ MAN8= nsd.8 zonec.8 nsdc.8 nsd-notify.8 nsd-xfer.8 +.include + +.if ${OSVERSION} > 700006 +RC_SCRIPT= nsd +.else +RC_SCRIPT= nsd.sh +.endif + +PLIST_SUB= RC_SCRIPT="${RC_SCRIPT}" + PORTDOCS= README RELNOTES CREDITS DIFFERENCES REQUIREMENTS SCRIPTS_ENV= WRKDIRPREFIX="${WRKDIRPREFIX}" \ @@ -63,7 +73,7 @@ .endif post-install: - ${SED} ${SED_SCRIPT} < ${FILESDIR}/nsd.sh.tmpl >${WRKDIR}/nsd.sh + ${SED} ${SED_SCRIPT} < ${FILESDIR}/nsd.sh.tmpl >${WRKDIR}/${RC_SCRIPT} .if !defined(NOPORTDOCS) @${MKDIR} ${DOCSDIR} .for f in ${PORTDOCS} @@ -72,10 +82,10 @@ .endif ${INSTALL_DATA} ${WRKSRC}/nsd.zones.sample \ ${PREFIX}/etc/nsd/nsd.zones.sample - ${INSTALL_SCRIPT} ${WRKDIR}/nsd.sh ${PREFIX}/etc/rc.d/ + ${INSTALL_SCRIPT} ${WRKDIR}/${RC_SCRIPT} ${PREFIX}/etc/rc.d/ @${CAT} ${PKGMESSAGE} post-clean: @${RM} -f ${WRKDIRPREFIX}${.CURDIR}/Makefile.inc -.include +.include Index: pkg-plist =================================================================== RCS file: /home/pcvs/ports/dns/nsd/pkg-plist,v retrieving revision 1.4 diff -u -r1.4 pkg-plist --- pkg-plist 7 Feb 2005 21:51:13 -0000 1.4 +++ pkg-plist 2 Dec 2005 07:27:50 -0000 @@ -1,5 +1,5 @@ @comment $FreeBSD: ports/dns/nsd/pkg-plist,v 1.4 2005/02/07 21:51:13 edwin Exp $ -etc/rc.d/nsd.sh +etc/rc.d/%%RC_SCRIPT%% etc/nsd/nsd.zones.sample etc/nsd/nsdc.conf.sample sbin/nsd --------------090909020408020907030101--