From owner-freebsd-ports@FreeBSD.ORG Sun Sep 7 17:00:35 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 90FAA90B for ; Sun, 7 Sep 2014 17:00:35 +0000 (UTC) Received: from avasout08.plus.net (avasout08.plus.net [212.159.14.20]) by mx1.freebsd.org (Postfix) with ESMTP id 252291DD6 for ; Sun, 7 Sep 2014 17:00:34 +0000 (UTC) Received: from curlew.milibyte.co.uk ([84.92.153.232]) by avasout08 with smtp id oH0R1o004516WCc01H0TsE; Sun, 07 Sep 2014 18:00:27 +0100 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.1 cv=fsVSZTIf c=1 sm=1 tr=0 a=lfSX4pPLp9EkufIcToJk/A==:117 a=lfSX4pPLp9EkufIcToJk/A==:17 a=D7rCoLxHAAAA:8 a=0Bzu9jTXAAAA:8 a=OOzCJWdBeL0A:10 a=AenzEc9pQn8A:10 a=1kqVy6LcLxsA:10 a=ZTb9aqGL9YkA:10 a=8nJEP1OIZ-IA:10 a=6I5d2MoRAAAA:8 a=Cnv1yalUNM9XlCE1jawA:9 a=wPNLvfGTeEIA:10 Received: from curlew.lan ([192.168.1.13]) by curlew.milibyte.co.uk with esmtp (Exim 4.84) (envelope-from ) id 1XQfpA-0000iB-Vo for freebsd-ports@freebsd.org; Sun, 07 Sep 2014 18:00:25 +0100 From: Mike Clarke To: freebsd-ports@freebsd.org Date: Sun, 07 Sep 2014 18:00:24 +0100 Message-ID: <6382694.vtzGnnjiph@curlew.lan> User-Agent: KMail/4.12.5 (FreeBSD/9.3-RELEASE; KDE/4.12.5; amd64; ; ) In-Reply-To: References: <20140907090321.12bbc428.ohartman@zedat.fu-berlin.de> <3855474.cM0CkAr3yg@curlew.lan> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 192.168.1.13 X-SA-Exim-Mail-From: jmc-freebsd2@milibyte.co.uk X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on curlew.lan X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 Subject: Re: service doen't get started at boottime, but can start manually Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="iso-8859-1" X-SA-Exim-Version: 4.2 X-SA-Exim-Scanned: Yes (on curlew.milibyte.co.uk) 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: Sun, 07 Sep 2014 17:00:35 -0000 On Sunday 07 Sep 2014 09:53:51 Scot Hetzel wrote: > The scripts in 3-6, and 8 are wrong. According to /etc/rc.subr, the > '# PROVIDE: ' is mandatory to detect a rc script: Well it appears that they are only half wrong. Scripts without PROVIDE will work if they're in /etc/rc.d but not if in /usr/local/etc/rc.d. I have run a test case to confirm this. In /etc/rc we have: 95 # Do a first pass to get everything up to $early_late_divider so that 96 # we can do a second pass that includes $local_startup directories 97 # 98 files=`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* 2>/dev/null` 99 100 _rc_elem_done=' ' 101 for _rc_elem in ${files}; do 102 run_rc_script ${_rc_elem} ${_boot} 103 _rc_elem_done="${_rc_elem_done}${_rc_elem} " 104 105 case "$_rc_elem" in 106 */${early_late_divider}) break ;; 107 esac 108 done 109 110 unset files local_rc 111 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 119 120 # The firstboot sentinel might be on a newly mounted filesystem; look for it 121 # again and unset skip_firstboot if we find it. 122 if [ -e ${firstboot_sentinel} ]; then 123 skip_firstboot="" 124 fi 125 126 files=`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* ${local_rc} 2>/dev/null` 127 for _rc_elem in ${files}; do 128 case "$_rc_elem_done" in 129 *" $_rc_elem "*) continue ;; 130 esac 131 132 run_rc_script ${_rc_elem} ${_boot} 133 done 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? -- Mike Clarke