NetBSD Problem Report #46601

From jbernard@knox.mines.edu  Fri Jun 15 03:13:47 2012
Return-Path: <jbernard@knox.mines.edu>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	by www.NetBSD.org (Postfix) with ESMTP id C7C5963B8E6
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 15 Jun 2012 03:13:46 +0000 (UTC)
Message-Id: <201206150313.q5F3Didg001261@knox.mines.edu>
Date: Thu, 14 Jun 2012 21:13:44 -0600 (MDT)
From: jbernard@mines.edu
Reply-To: jbernard@mines.edu
To: gnats-bugs@gnats.NetBSD.org
Subject: add support for rc_directories to rc.shutdown
X-Send-Pr-Version: 3.95

>Number:         46601
>Category:       misc
>Synopsis:       rc does, but rc.shutdown does not, support rc_directories
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    jnemeth
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri Jun 15 03:15:00 +0000 2012
>Closed-Date:    Mon Jul 02 21:24:25 +0000 2012
>Last-Modified:  Mon Jul 02 21:25:00 +0000 2012
>Originator:     Jim Bernard
>Release:        NetBSD 6.99.7
>Organization:
self
>Environment:
System: NetBSD 6.99.7 #0: Wed Jun 13 19:59:26 MDT 2012 i386
Architecture: i386
Machine: i386
>Description:
	Some time ago, /etc/rc acquired support for multiple directories
	containing rc.d scripts, specified in the rc.conf variable
	rc_directories.  The same need exists in rc.shutdown, but
	the feature was not added to it.

>How-To-Repeat:
	Have startup scripts in /usr/pkg/etc/rc.d or some other
	location besides /etc/rc.d and run shutdown.  Note that
	none of the scripts in alternative directories is executed.
	Or compare the rc and rc.shutdown scripts in the vicinity
	of the invocation of rcorder.

>Fix:
	Just augment /etc/rc.shutdown in the same way that /etc/rc
	was long ago:

--- rc.shutdown-dist	2012-06-13 16:37:03.000000000 -0600
+++ rc.shutdown	2012-06-14 20:44:11.000000000 -0600
@@ -42,14 +42,16 @@
 	    ) &
 	_rcshutdown_watchdog=$!
 fi


-#	Determine the shutdown order of the /etc/rc.d scripts,
+#	Determine the shutdown order of the rc.d scripts,
 #	and perform the operation
 #
-files=$(rcorder -k shutdown ${rcshutdown_rcorder_flags} /etc/rc.d/*)
+scripts=$(for rcd in ${rc_directories:-/etc/rc.d}; do
+	test -d ${rcd} && echo ${rcd}/*; done)
+files=$(rcorder -k shutdown ${rcshutdown_rcorder_flags} ${scripts})

 for _rc_elem in $(reverse_list $files); do
 	run_rc_script $_rc_elem stop
 done


>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: misc-bug-people->jnemeth
Responsible-Changed-By: jnemeth@NetBSD.org
Responsible-Changed-When: Mon, 25 Jun 2012 07:23:59 +0000
Responsible-Changed-Why:
I made the fix; should pull this up...


From: "John Nemeth" <jnemeth@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/46601 CVS commit: src/etc
Date: Mon, 25 Jun 2012 07:22:46 +0000

 Module Name:	src
 Committed By:	jnemeth
 Date:		Mon Jun 25 07:22:46 UTC 2012

 Modified Files:
 	src/etc: rc.shutdown

 Log Message:
 PR/46601 - Jim Bernard -- add support for rc_directories


 To generate a diff of this commit:
 cvs rdiff -u -r1.8 -r1.9 src/etc/rc.shutdown

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->pending-pullups
State-Changed-By: jnemeth@NetBSD.org
State-Changed-When: Mon, 25 Jun 2012 08:02:00 +0000
State-Changed-Why:
pullup request sent: [pullup-6 #375]


State-Changed-From-To: pending-pullups->closed
State-Changed-By: jdc@NetBSD.org
State-Changed-When: Mon, 02 Jul 2012 21:24:25 +0000
State-Changed-Why:
Pull up 375 processed.


From: "Julian Coleman" <jdc@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/46601 CVS commit: [netbsd-6] src/etc
Date: Mon, 2 Jul 2012 21:20:52 +0000

 Module Name:	src
 Committed By:	jdc
 Date:		Mon Jul  2 21:20:52 UTC 2012

 Modified Files:
 	src/etc [netbsd-6]: rc.shutdown

 Log Message:
 Pull up revision 1.9 (requested by jnemeth in ticket #375).

 PR/46601 - Jim Bernard -- add support for rc_directories


 To generate a diff of this commit:
 cvs rdiff -u -r1.8 -r1.8.60.1 src/etc/rc.shutdown

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.