From nobody@FreeBSD.org  Mon Dec 10 20:58:10 2001
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id BE3D837B416
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 10 Dec 2001 20:58:06 -0800 (PST)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.6/8.11.6) id fBB4w6a11383;
	Mon, 10 Dec 2001 20:58:06 -0800 (PST)
	(envelope-from nobody)
Message-Id: <200112110458.fBB4w6a11383@freefall.freebsd.org>
Date: Mon, 10 Dec 2001 20:58:06 -0800 (PST)
From: Nicholas Paufler <echofox@discordia.ca>
To: freebsd-gnats-submit@FreeBSD.org
Subject: scripts in /usr/local/etc/rc.d not executed in 4.4-STABLE
X-Send-Pr-Version: www-1.0

>Number:         32687
>Category:       misc
>Synopsis:       scripts in /usr/local/etc/rc.d not executed in 4.4-STABLE
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    roam
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Dec 10 21:00:02 PST 2001
>Closed-Date:    Wed Dec 19 22:31:45 PST 2001
>Last-Modified:  Wed Dec 19 22:32:28 PST 2001
>Originator:     Nicholas Paufler
>Release:        FreeBSD 4.4-STABLE #0: Mon Dec 10 18:49:42 MST 2001
>Organization:
>Environment:
FreeBSD www.discordia.ca 4.4-STABLE FreeBSD 4.4-STABLE #0: Mon Dec 10 18:49:42 MST 2001     root@www.discordia.ca:/usr/obj/usr2/src/sys/DISCORDIA  i386
>Description:
After doing an upgrade from 4.3-STABLE (built May 08 2001) to 4.4-STABLE (built Dec 10 2001) I noticed that local packages being started via scripts in /usr/local/etc/rc.d were not being executed upon reboot.
I'd done a mergemaster after completing the make installworld in which I installed all new files except for rc.conf and rc.firewall.

I eventually traced the problem to /etc/rc
For whatever reason the local package initialization section of that file was failing to function correctly. I edited that file and pasted in the section from a different 4.3-STABLE machine, rebooted and the problem was solved. All local packages (apache, dhcpd, mysql) started properly.
>How-To-Repeat:
Local packages will not be initialized until that section of /etc/rc is replaced so every time the computer reboots the problem will repeat.
>Fix:
In the /etc/rc for 4.4-STABLE as of December 10th:
Replace the current section:
case ${local_startup} in
[Nn][Oo] | '')
        ;;
*)
        echo -n 'Local package initialization:'
        slist=""
        for dir in ${local_startup}; do
                if [ -d "${dir}" ]; then
                        for script in ${dir}/*.sh; do
                                slist="${slist}${script_name_sep}${script}"
                        done
                fi
        done
        script_save_sep="$IFS"
        IFS="${script_name_sep}"
        for script in ${slist}; do
                if [ -x "${script}" ]; then
                        (set -T
                        trap 'exit 1' 2
                        ${script} start)
                fi
        done
        IFS="${script_save_sep}"
        echo '.'
        ;;
esac

With an earlier version of that section, such as the following taken from a 4.3-STABLE system:

case ${local_startup} in
[Nn][Oo] | '')
        ;;
*)
        echo -n 'Local package initialization:'
        for dir in ${local_startup}; do
                if [ -d "${dir}" ]; then
                        for script in ${dir}/*.sh; do
                                if [ -x "${script}" ]; then
                                        (set -T
                                         trap 'exit 1' 2
                                         ${script} start)
                                fi
                        done
                fi
        done
        echo '.'
        ;;
esac

I'm guessing that there is a typo or some other problem in the local package init section of the current /etc/rc which is causing the problem.
>Release-Note:
>Audit-Trail:

From: Peter Pentchev <roam@ringlet.net>
To: Nicholas Paufler <echofox@discordia.ca>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: misc/32687: scripts in /usr/local/etc/rc.d not executed in 4.4-STABLE
Date: Tue, 11 Dec 2001 17:50:55 +0200

 On Mon, Dec 10, 2001 at 08:58:06PM -0800, Nicholas Paufler wrote:
 > 
 > >Number:         32687
 > >Category:       misc
 > >Synopsis:       scripts in /usr/local/etc/rc.d not executed in 4.4-STABLE
 > >Originator:     Nicholas Paufler
 > >Release:        FreeBSD 4.4-STABLE #0: Mon Dec 10 18:49:42 MST 2001
 > >Organization:
 > >Environment:
 > FreeBSD www.discordia.ca 4.4-STABLE FreeBSD 4.4-STABLE #0: Mon Dec 10 18:49:42 MST 2001     root@www.discordia.ca:/usr/obj/usr2/src/sys/DISCORDIA  i386
 > >Description:
 > After doing an upgrade from 4.3-STABLE (built May 08 2001) to 4.4-STABLE (built Dec 10 2001) I noticed that local packages being started via scripts in /usr/local/etc/rc.d were not being executed upon reboot.
 > I'd done a mergemaster after completing the make installworld in which I installed all new files except for rc.conf and rc.firewall.
 
 OK, dumb question: does your /etc/defaults/rc.conf have a line like:
 script_name_sep=" "	# Change if your startup scripts' names contain spaces
 
 G'luck,
 Peter
 
 -- 
 What would this sentence be like if it weren't self-referential?

From: Peter Pentchev <roam@ringlet.net>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: misc/32687: scripts in /usr/local/etc/rc.d not executed in 4.4-STABLE
Date: Tue, 11 Dec 2001 18:12:23 +0200

 Forwarding a message from the submitter to put it on the audit trail..
 
 G'luck,
 Peter
 
 -- 
 If the meanings of 'true' and 'false' were switched, then this sentence wouldn't be false.
 
 ----- Forwarded message from Nicholas Echo|Fox Paufler <echofox@discordia.ca> -----
 
 Date: Tue, 11 Dec 2001 09:04:36 -0700 (MST)
 From: "Nicholas \"Echo|Fox\" Paufler" <echofox@discordia.ca>
 X-Sender: echofox@kindercampus.ab.ca
 To: Peter Pentchev <roam@ringlet.net>
 Subject: Re: misc/32687: scripts in /usr/local/etc/rc.d not executed in
  4.4-STABLE
 In-Reply-To: <20011211175055.A578@straylight.oblivion.bg>
 
 > 
 > OK, dumb question: does your /etc/defaults/rc.conf have a line like:
 > script_name_sep=" "	# Change if your startup scripts' names contain spaces
 > 
 > G'luck,
 > Peter
 > 
 
 Nope, that it does not. ...
 Ahhh.. just looking at the line now. I get what the problem is. since
 script_name_sep is undefined, slist is going to be equal to something like
 "apache.shmysql.shdhcpd.sh" and thus isn't going to exceute them because
 obviously such a file does not exist.
 
 So I take it my problem is an old and crufty version of
 /etc/defaults/rc.conf, then? Hmm. I would have thought mergemaster would
 have installed a current one, especially in a case where stuff is
 dependent on new additions to it.
 
 I trust that copying over /usr/src/etc/defaults/rc.conf should take care
 of my problems?
 
 Thanks for your help.
 
 Nicholas Paufler
 
 
 
 ----- End forwarded message -----
State-Changed-From-To: open->closed 
State-Changed-By: roam 
State-Changed-When: Tue Dec 11 08:27:40 PST 2001 
State-Changed-Why:  
It turns out that the mergemaster run had for some reason 
not updated /etc/defaults/rc.conf. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=32687 

From: Sheldon Hearn <sheldonh@starjuice.net>
To: Peter Pentchev <roam@ringlet.net>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: misc/32687: scripts in /usr/local/etc/rc.d not executed in 4.4-STABLE 
Date: Tue, 11 Dec 2001 18:28:35 +0200

 On Tue, 11 Dec 2001 08:20:01 PST, Peter Pentchev wrote:
 
 >  Ahhh.. just looking at the line now. I get what the problem is. since
 >  script_name_sep is undefined, slist is going to be equal to something like
 >  "apache.shmysql.shdhcpd.sh" and thus isn't going to exceute them because
 >  obviously such a file does not exist.
 
 Peter, do you think it's worth building a default value for script_name_sep
 into rc itself so this doesn't bite folks in the 4.5-RELEASE upgrade?
 
 I accept that you'd have to try hard to be bitten, but this little bit
 of ugliness may save us a few PRs?
 
 Ciao,
 Sheldon.
State-Changed-From-To: closed->analyzed 
State-Changed-By: roam 
State-Changed-When: Tue Dec 11 08:37:51 PST 2001 
State-Changed-Why:  
Actually, Sheldon suggested a helpful workaround. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=32687 

From: Peter Pentchev <roam@ringlet.net>
To: Sheldon Hearn <sheldonh@starjuice.net>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: misc/32687: scripts in /usr/local/etc/rc.d not executed in 4.4-STABLE
Date: Tue, 11 Dec 2001 18:51:49 +0200

 On Tue, Dec 11, 2001 at 08:30:01AM -0800, Sheldon Hearn wrote:
 > The following reply was made to PR misc/32687; it has been noted by GNATS.
 > 
 >  On Tue, 11 Dec 2001 08:20:01 PST, Peter Pentchev wrote:
 >  
 >  >  Ahhh.. just looking at the line now. I get what the problem is. since
 >  >  script_name_sep is undefined, slist is going to be equal to something like
 >  >  "apache.shmysql.shdhcpd.sh" and thus isn't going to exceute them because
 >  >  obviously such a file does not exist.
 >  
 >  Peter, do you think it's worth building a default value for script_name_sep
 >  into rc itself so this doesn't bite folks in the 4.5-RELEASE upgrade?
 >  
 >  I accept that you'd have to try hard to be bitten, but this little bit
 >  of ugliness may save us a few PRs?
 
 This makes sense.  How about the attached patch?
 The warning message clutters the output, though; it almost certainly
 overflows to the next line on the screen, not to mention overflowing
 the 80-character source line..  I am thinking of shortening it somehow,
 maybe you or somebody else could suggest another wording?
 
 G'luck,
 Peter
 
 -- 
 I am the meaning of this sentence.
 
 Index: src/etc/rc
 ===================================================================
 RCS file: /home/ncvs/src/etc/rc,v
 retrieving revision 1.287
 diff -u -r1.287 rc
 --- src/etc/rc	11 Dec 2001 08:21:45 -0000	1.287
 +++ src/etc/rc	11 Dec 2001 16:43:24 -0000
 @@ -813,6 +813,10 @@
  *)
  	echo -n 'Local package initialization:'
  	slist=""
 +	if [ -z "${script_name_sep}" ]; then
 +		echo -n ' Empty script_name_sep, setting a default value of " "..'
 +		script_name_sep=" "
 +	fi
  	for dir in ${local_startup}; do
  		if [ -d "${dir}" ]; then
  			for script in ${dir}/*.sh; do
 Index: src/etc/rc.shutdown
 ===================================================================
 RCS file: /home/ncvs/src/etc/rc.shutdown,v
 retrieving revision 1.20
 diff -u -r1.20 rc.shutdown
 --- src/etc/rc.shutdown	24 Nov 2001 16:12:03 -0000	1.20
 +++ src/etc/rc.shutdown	11 Dec 2001 16:42:36 -0000
 @@ -103,6 +103,10 @@
  	;;
  *)
  	slist=""
 +	if [ -z "${script_name_sep}" ]; then
 +		echo -n ' Empty script_name_sep, setting a default value of " "..'
 +		script_name_sep=" "
 +	fi
  	for dir in ${local_startup}; do
  		if [ -d "${dir}" ]; then
  			for script in ${dir}/*.sh; do

From: Sheldon Hearn <sheldonh@starjuice.net>
To: Peter Pentchev <roam@ringlet.net>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: misc/32687: scripts in /usr/local/etc/rc.d not executed in 4.4-STABLE 
Date: Tue, 11 Dec 2001 19:00:07 +0200

 On Tue, 11 Dec 2001 18:51:49 +0200, Peter Pentchev wrote:
 
 > This makes sense.  How about the attached patch?
 > The warning message clutters the output, though; it almost certainly
 > overflows to the next line on the screen, not to mention overflowing
 > the 80-character source line..  I am thinking of shortening it somehow,
 > maybe you or somebody else could suggest another wording?
 
 I'd suggest removing the warning altogether.  Anyone who's managed to
 mangle things in a 4.5-RELEASE upgrade to the point where they see this
 message is unlikely to know how to make it go away.
 
 I like the rest of the patch. :-)
 
 Ciao,
 Sheldon.

From: Peter Pentchev <roam@ringlet.net>
To: Sheldon Hearn <sheldonh@starjuice.net>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: misc/32687: scripts in /usr/local/etc/rc.d not executed in 4.4-STABLE
Date: Tue, 11 Dec 2001 19:05:35 +0200

 On Tue, Dec 11, 2001 at 07:00:07PM +0200, Sheldon Hearn wrote:
 > 
 > 
 > On Tue, 11 Dec 2001 18:51:49 +0200, Peter Pentchev wrote:
 > 
 > > This makes sense.  How about the attached patch?
 > > The warning message clutters the output, though; it almost certainly
 > > overflows to the next line on the screen, not to mention overflowing
 > > the 80-character source line..  I am thinking of shortening it somehow,
 > > maybe you or somebody else could suggest another wording?
 > 
 > I'd suggest removing the warning altogether.  Anyone who's managed to
 > mangle things in a 4.5-RELEASE upgrade to the point where they see this
 > message is unlikely to know how to make it go away.
 > 
 > I like the rest of the patch. :-)
 
 Okay; the warning was actually an afterthought :)
 
 If nobody objects, I will commit the attached patch tomorrow morning
 (my morning, about twelve hours from now :)
 
 G'luck,
 Peter
 
 -- 
 If the meanings of 'true' and 'false' were switched, then this sentence wouldn't be false.
 
 Index: src/etc/rc
 ===================================================================
 RCS file: /home/ncvs/src/etc/rc,v
 retrieving revision 1.287
 diff -u -r1.287 rc
 --- src/etc/rc	11 Dec 2001 08:21:45 -0000	1.287
 +++ src/etc/rc	11 Dec 2001 17:04:51 -0000
 @@ -813,6 +813,9 @@
  *)
  	echo -n 'Local package initialization:'
  	slist=""
 +	if [ -z "${script_name_sep}" ]; then
 +		script_name_sep=" "
 +	fi
  	for dir in ${local_startup}; do
  		if [ -d "${dir}" ]; then
  			for script in ${dir}/*.sh; do
 Index: src/etc/rc.shutdown
 ===================================================================
 RCS file: /home/ncvs/src/etc/rc.shutdown,v
 retrieving revision 1.20
 diff -u -r1.20 rc.shutdown
 --- src/etc/rc.shutdown	24 Nov 2001 16:12:03 -0000	1.20
 +++ src/etc/rc.shutdown	11 Dec 2001 17:04:52 -0000
 @@ -103,6 +103,9 @@
  	;;
  *)
  	slist=""
 +	if [ -z "${script_name_sep}" ]; then
 +		script_name_sep=" "
 +	fi
  	for dir in ${local_startup}; do
  		if [ -d "${dir}" ]; then
  			for script in ${dir}/*.sh; do
Responsible-Changed-From-To: freebsd-bugs->roam 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Wed Dec 12 00:40:24 PST 2001 
Responsible-Changed-Why:  
Peter's gonna deal with this one. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=32687 
State-Changed-From-To: analyzed->suspended 
State-Changed-By: roam 
State-Changed-When: Wed Dec 12 02:16:52 PST 2001 
State-Changed-Why:  
I committed the fix to -current, will MFC it in a week. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=32687 
State-Changed-From-To: suspended->closed 
State-Changed-By: roam 
State-Changed-When: Wed Dec 19 22:31:45 PST 2001 
State-Changed-Why:  
The initialization of script_name_sep with a sane value was MFC'd 
into -stable yesterday. 
Thank you for the problem report! 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=32687 
>Unformatted:
