From owner-freebsd-rc@FreeBSD.ORG Tue Jul 27 16:34:22 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 12FB716A4CE; Tue, 27 Jul 2004 16:34:22 +0000 (GMT) Received: from telecom.net.et (ns2.telecom.net.et [213.55.64.38]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4B22043D54; Tue, 27 Jul 2004 16:34:19 +0000 (GMT) (envelope-from mtm@identd.net) Received: from [213.55.65.180] (HELO pool-151-200-10-97.res.east.verizon.net) by telecom.net.et (CommuniGate Pro SMTP 3.4.8) with ESMTP-TLS id 52779605; Tue, 27 Jul 2004 19:27:31 +0300 Received: from rogue.acs-et.com (localhost [127.0.0.1]) ESMTP id i6RGYW6S081470; Tue, 27 Jul 2004 19:34:45 +0300 (EAT) (envelope-from mtm@rogue.acs-et.com) Received: (from mtm@localhost) by rogue.acs-et.com (8.12.11/8.12.11/Submit) id i6RGYRrL081469; Tue, 27 Jul 2004 19:34:27 +0300 (EAT) (envelope-from mtm) Date: Tue, 27 Jul 2004 19:34:26 +0300 From: Mike Makonnen To: Peter Pentchev Message-ID: <20040727163426.GB81394@rogue.acs-et.com> References: <20040727123712.GA1196@straylight.m.ringlet.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040727123712.GA1196@straylight.m.ringlet.net> User-Agent: Mutt/1.4.2.1i X-Operating-System: FreeBSD/5.2-CURRENT (i386) cc: Mike Makonnen 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: Tue, 27 Jul 2004 16:34:22 -0000 On Tue, Jul 27, 2004 at 03:37:12PM +0300, Peter Pentchev wrote: > Hi, > > With the recent changes to rc.subr so that it executes port startup scripts > 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 quick > patch which works around this problem, but may introduce others - I'm not > quite sure I understand all of rc.subr's internal workings :) > 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. 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. Cheers. -- Mike Makonnen | GPG-KEY: http://www.identd.net/~mtm/mtm.asc mtm@identd.net | Fingerprint: AC7B 5672 2D11 F4D0 EBF8 5279 5359 2B82 7CD4 1F55 mtm@FreeBSD.Org| FreeBSD - Unleash the Daemon !