From owner-freebsd-rc@FreeBSD.ORG Wed Jul 28 12:02:30 2004 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0B74816A4CE for ; Wed, 28 Jul 2004 12:02:30 +0000 (GMT) Received: from gandalf.online.bg (gandalf.online.bg [217.75.128.9]) by mx1.FreeBSD.org (Postfix) with SMTP id 8EC9043D53 for ; Wed, 28 Jul 2004 12:02:28 +0000 (GMT) (envelope-from roam@ringlet.net) Received: (qmail 15917 invoked from network); 28 Jul 2004 11:57:12 -0000 Received: from unknown (HELO straylight.m.ringlet.net) (217.75.134.254) by gandalf.online.bg with SMTP; 28 Jul 2004 11:57:12 -0000 Received: (qmail 16490 invoked by uid 1000); 28 Jul 2004 12:02:28 -0000 Date: Wed, 28 Jul 2004 15:02:28 +0300 From: Peter Pentchev To: Mike Makonnen Message-ID: <20040728120228.GA1390@straylight.m.ringlet.net> References: <20040727123712.GA1196@straylight.m.ringlet.net> <20040727163426.GB81394@rogue.acs-et.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="HlL+5n6rz5pIUxbD" Content-Disposition: inline In-Reply-To: <20040727163426.GB81394@rogue.acs-et.com> User-Agent: Mutt/1.5.6i cc: freebsd-rc@freebsd.org Subject: Re: rc.subr exits prematurely X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to /etc/rc.d design and implementation. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jul 2004 12:02:30 -0000 --HlL+5n6rz5pIUxbD Content-Type: text/plain; charset=windows-1251 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jul 27, 2004 at 07:34:26PM +0300, Mike Makonnen wrote: > On Tue, Jul 27, 2004 at 03:37:12PM +0300, Peter Pentchev wrote: > > Hi, > >=20 > > With the recent changes to rc.subr so that it executes port startup scr= ipts > > in the same shell instead of in a subshell, another problem has come up. > > For the scripts which record a PID file, a check is made on startup and= on > > shutdown for the PID file's existence, and if it fails, rc.subr exits, = which > > prevents the rest of the scripts from being executed. Attached is a qu= ick > > patch which works around this problem, but may introduce others - I'm n= ot > > quite sure I understand all of rc.subr's internal workings :) > >=20 >=20 > The brokeness is in the port startup script. One of the things ports > scripts need to do is install the script without a .sh suffix, so that > it does not get executed in the parent shell, and instead in a subshell. >=20 > The only things that should get executed in the same shell are scripts > like rc.d/rcconf.sh, which is there to load the contents of rc.conf. Okay, so rc scripts that expect to be called in a subshell should be named without the '.sh' suffix. What does this mean for 4.x though, where only scripts *with* the '.sh' suffix are ever executed? Should the ports provide differently-named scripts for 4.x and 5.x (or rather, for OSVERSION's before and after the rc.subr overhaul)? G'luck, Peter --=20 Peter Pentchev roam@ringlet.net roam@cnsys.bg roam@FreeBSD.org PGP key: http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553 When you are not looking at it, this sentence is in Spanish. --HlL+5n6rz5pIUxbD Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFBB5XU7Ri2jRYZRVMRAqaKAJ9PWFHAjmUWfa1jc1txHoP8h4mM4wCeJH9U mwu0O1tdIZj5jDnDuzxUvQI= =rA6v -----END PGP SIGNATURE----- --HlL+5n6rz5pIUxbD--