From owner-freebsd-ports@FreeBSD.ORG Mon Sep 8 07:47:22 2014 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0E9F5CFB; Mon, 8 Sep 2014 07:47:22 +0000 (UTC) Received: from mailout04.t-online.de (mailout04.t-online.de [194.25.134.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mailout00.t-online.de", Issuer "TeleSec ServerPass DE-1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ACF6F132C; Mon, 8 Sep 2014 07:47:21 +0000 (UTC) Received: from fwd02.aul.t-online.de (fwd02.aul.t-online.de [172.20.26.148]) by mailout04.t-online.de (Postfix) with SMTP id 2C245286665; Mon, 8 Sep 2014 09:47:11 +0200 (CEST) Received: from [192.168.119.33] (Gt8YbGZLYhSfl1Ozd8Ie4PSVNxOf+E1+GJLI2DYs1qOueZiBKj7ooQx3HvKZKf0Qpq@[84.154.101.219]) by fwd02.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-SHA encrypted) esmtp id 1XQtfK-0A6gSW0; Mon, 8 Sep 2014 09:47:10 +0200 Message-ID: <540D5EFB.50402@freebsd.org> Date: Mon, 08 Sep 2014 09:47:07 +0200 From: Stefan Esser User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 MIME-Version: 1.0 To: Mike Clarke , freebsd-ports@freebsd.org Subject: Re: service doen't get started at boottime, but can start manually References: <20140907090321.12bbc428.ohartman@zedat.fu-berlin.de> <3855474.cM0CkAr3yg@curlew.lan> <6382694.vtzGnnjiph@curlew.lan> In-Reply-To: <6382694.vtzGnnjiph@curlew.lan> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-ID: Gt8YbGZLYhSfl1Ozd8Ie4PSVNxOf+E1+GJLI2DYs1qOueZiBKj7ooQx3HvKZKf0Qpq X-TOI-MSGID: 8058306e-3a10-46dd-b122-69611df6bd15 X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Sep 2014 07:47:22 -0000 Am 07.09.2014 um 19:00 schrieb Mike Clarke: > So all files in /etc/rd.d are potential startup scripts but those in > /usr/local/etc must meet the requirement of having a PROVIDE line. > > This inconsistency isn't mentioned anywhere in the examples in > so > it looks like either the documentation needs this adding or perhaps > the test for PROVIDE in find_local_scripts_new() should be replaced by > a test for defining the variable "name" (which is mandatory) or > perhaps there's no longer any need to apply this test? This was for a reason: There used to be an etc/rc.local (not sure about its name at that time) that just invoked all scripts found in /usr/local/etc/rc.d in alphabetical order, ignoring backup scripts ending in e.g. "~". Scripts where started without argument, there was no stop function and thus no way to stop a local service from a rc.d script before shutdown. (This logic is still found in "rc.d/localpkg" - it does try to perform a stop operation though, which is different from the old behaviour AFAIR. Legacy startup scripts did not check for any parameters being passed to them ...) > In /etc/rc we have: [...] > 112 # Now that disks are mounted, for each dir in $local_startup > 113 # search for init scripts that use the new rc.d semantics. > 114 # > 115 case ${local_startup} in > 116 [Nn][Oo] | '') ;; > 117 *) find_local_scripts_new ;; > 118 esac [...] (The above sets ${local_rc} > 126 files=`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* ${local_rc} 2>/dev/null` When local/etc/rc.d was included into the rcorder based dependency calculation, there still were many "old" scripts. Invoking them at shutdown could lead to bad effects and they lacked the parameters required for dependency calculation. (IIRC, these used to have a ".sh" extension, but I'm not sure whether it was mandatory in order to have them executed by rc.d/local.) A simple mechanism was required to distinguish scripts that should still be started in alphabetic order and only on startup from those that had dependency information (to be sorted by rcorder and to be invoced with "stop" on shutdown). And checking for "PROVIDE:" is a simple discriminator, which selects the mechanism to use, without relying on the file name (which did not follow a strict scheme and presence or absence of ".sh" was no good indicator). This logic (and dependency on PROVIDE: for local startup files) exists as long as they have been included in the rcorder calculation. And it may still be a sensible requirement, since there might be local startup scripts that never made it into the tree or into a port, which rely on this behaviour. This is obviously a shortcoming in the documentation, which should be fixed. AFAIK, the old style startup files have never been deprecated and are still fully supported ... Regards, STefan