From owner-freebsd-current@FreeBSD.ORG Sat Dec 3 01:49:28 2005 Return-Path: X-Original-To: freebsd-current@FreeBSD.ORG Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DDE6016A420 for ; Sat, 3 Dec 2005 01:49:27 +0000 (GMT) (envelope-from dougb@FreeBSD.org) Received: from mail1.fluidhosting.com (mail1.fluidhosting.com [204.14.90.11]) by mx1.FreeBSD.org (Postfix) with SMTP id 8197C43D64 for ; Sat, 3 Dec 2005 01:49:26 +0000 (GMT) (envelope-from dougb@FreeBSD.org) Received: (qmail 28399 invoked by uid 399); 3 Dec 2005 01:49:25 -0000 Received: from unknown (HELO ?192.168.0.5?) (dougb@dougbarton.net@127.0.0.1) by 127.0.0.1 with SMTP; 3 Dec 2005 01:49:25 -0000 Message-ID: <4390F9A2.208@FreeBSD.org> Date: Fri, 02 Dec 2005 17:49:22 -0800 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Thunderbird 1.5 (Windows/20051025) MIME-Version: 1.0 To: Andrey Chernov , freebsd-current@FreeBSD.ORG References: <200512022006.jB2K67AK078509@repoman.freebsd.org> <20051203004057.GA20872@nagual.pp.ru> <4390EFB6.3090307@FreeBSD.org> <20051203012324.GA34147@nagual.pp.ru> In-Reply-To: <20051203012324.GA34147@nagual.pp.ru> X-Enigmail-Version: 0.93.1.0 Content-Type: multipart/mixed; boundary="------------080802060406030009020905" Cc: Subject: Re: cvs commit: src/etc rc rc.shutdown rc.subr src/etc/rc.d localpkg src/sys/sys param.h X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2005 01:49:28 -0000 This is a multi-part message in MIME format. --------------080802060406030009020905 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Andrey Chernov wrote: > On Fri, Dec 02, 2005 at 05:07:02PM -0800, Doug Barton wrote: >> Yes, I agree that's a problem. However, it's a problem we have to solve, or >> else we can't include local scripts in the base rcorder. As I wrote in my > > What prevents to include them in the base rcorder AND run in the separate > subshell (sort of sandbox) in the same time? Perhaps just few variables > need to be added. Well, unfortunately it's a little more complicated than that. The rc.d system has some default assumptions about the specialness of scripts that end in .sh, and while I don't necessarily agree with that, I didn't want to redo it all. > Typical problem for porter (like me) is not knowing deeps of rc.d > subsystem. To be more specific, personally me can't make 'apache13' port > do its limits without damaging main rc shell in the same time. If you can, > please look 'apache13' port and feel free to fix rc script there. I'm sorry if I wasn't clear before, the only thing port authors need to do for properly functioning rc.d-style scripts is to install them as foo instead of foo.sh. I have attached an untested patch for apache13 that should do the trick, or at least show you what I have in mind. At some point down the road, when we've dropped support for releases prior to 6.1, this will simply be the way that all such scripts are installed, but between now and then, there will be some transition pain involved. > I suspect I am not only one with such problem. Lots of environment things > can be damaged not running in the subshell: su, environment variables, > limits, etc. etc. What you provide as example is simplest case which cause > no problems, but I talk about problem cases, not simplest ones. *nod* I fully acknowledge that there will be problems, and I am willing to revisit this approach down the road if it looks like it's causing more pain than it's worth. At this point though, I think we just have to let it play out. Doug --------------080802060406030009020905 Content-Type: text/plain; name="apache13.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="apache13.diff" Index: Makefile =================================================================== RCS file: /usr/local/ncvs/ports/www/apache13/Makefile,v retrieving revision 1.163 diff -u -r1.163 Makefile --- Makefile 25 Nov 2005 03:17:11 -0000 1.163 +++ Makefile 3 Dec 2005 01:43:07 -0000 @@ -144,6 +144,14 @@ MAN8= ab.8 apachectl.8 apxs.8 httpd.8 logresolve.8 rotatelogs.8 \ ${SUEXEC_MAN} +.if ${OSVERSION} > 700006 +RC_SCRIPT= apache +.else +RC_SCRIPT= apache.sh +.endif + +PLIST_SUB= RC_SCRIPT="${RC_SCRIPT}" + post-extract: @${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \ ${FILESDIR}/apache.sh > ${WRKSRC}/apache.sh @@ -153,10 +161,10 @@ PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL post-install: - ${INSTALL_SCRIPT} ${WRKSRC}/apache.sh ${PREFIX}/etc/rc.d/apache.sh + ${INSTALL_SCRIPT} ${WRKSRC}/apache.sh ${PREFIX}/etc/rc.d/${RC_SCRIPT} @${TOUCH} ${DOCUMENT_ROOT}-dist/EXAMPLE_DIRECTORY-DONT_ADD_OR_TOUCH_ANYTHING @${TOUCH} ${CGIBIN_ROOT}-dist/EXAMPLE_DIRECTORY-DONT_ADD_OR_TOUCH_ANYTHING @${CHMOD} a-w ${DOCUMENT_ROOT}-dist ${CGIBIN_ROOT}-dist @${CAT} ${PKGMESSAGE} -.include +.include Index: pkg-plist =================================================================== RCS file: /usr/local/ncvs/ports/www/apache13/pkg-plist,v retrieving revision 1.59 diff -u -r1.59 pkg-plist --- pkg-plist 18 Oct 2005 19:20:27 -0000 1.59 +++ pkg-plist 3 Dec 2005 01:41:13 -0000 @@ -18,7 +18,7 @@ @unexec if cmp -s %D/etc/apache/srm.conf %D/etc/apache/srm.conf-dist; then rm -f %D/etc/apache/srm.conf; fi etc/apache/srm.conf-dist @exec [ -f %B/srm.conf ] || cp %B/%f %B/srm.conf -etc/rc.d/apache.sh +etc/rc.d/%%RC_SCRIPT%% include/apache/ap.h include/apache/ap_alloc.h include/apache/ap_compat.h --------------080802060406030009020905--