NetBSD Problem Report #47326

From nakayosh@leto.eonet.ne.jp  Fri Dec 14 15:28:03 2012
Return-Path: <nakayosh@leto.eonet.ne.jp>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	by www.NetBSD.org (Postfix) with ESMTP id E848763E529
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 14 Dec 2012 15:28:02 +0000 (UTC)
Message-Id: <20121214152758.538041CF1B3@ae0000-mailauth11.eo.k-opti.ad.jp>
Date: Sat, 15 Dec 2012 00:27:58 +0900 (JST)
From: nakayosh@leto.eonet.ne.jp
Reply-To: nakayosh@leto.eonet.ne.jp
To: gnats-bugs@gnats.NetBSD.org
Subject: /etc/rc.d/random_seed fails
X-Send-Pr-Version: 3.95

>Number:         47326
>Category:       bin
>Synopsis:       /etc/rc.d/random_seed fails
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Dec 14 15:30:00 +0000 2012
>Closed-Date:    Mon Dec 17 10:27:49 +0000 2012
>Last-Modified:  Mon Dec 17 10:30:07 +0000 2012
>Originator:     NAKAJIMA Yoshihiro
>Release:        NetBSD-current/20121214
>Organization:
>Environment:
System: NetBSD asura 6.99.15 NetBSD 6.99.15 (ASURA) #4: Fri Dec 14 22:12:00 JST 2012 nakayosh@asura:/usr/src/sys/arch/amd64/compile/ASURA amd64
Architecture: x86_64
Machine: amd64
>Description:

/etc/rc.d/random_seed fails.
It requires /usr partition (/usr/bin/stat and so on),
but /usr isn't mounted yet.

> % /sbin/rcorder /etc/rc.d/* | egrep 'random_seed|mountcrit'
> /etc/rc.d/mountcritlocal
> /etc/rc.d/random_seed
> /etc/rc.d/mountcritremote

>How-To-Repeat:
>Fix:

>Release-Note:

>Audit-Trail:
From: Alan Barrett <apb@cequrux.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/47326: /etc/rc.d/random_seed fails
Date: Fri, 14 Dec 2012 20:00:08 +0200

 On Fri, 14 Dec 2012, nakayosh@leto.eonet.ne.jp wrote:
 >/etc/rc.d/random_seed fails.
 >It requires /usr partition (/usr/bin/stat and so on),
 >but /usr isn't mounted yet.

 I think we shgould try to remove the dependencies on
 /usr/bin/* commands.  I see the following external
 commands used by /etc/rc.d/random_seed:

 df (/bin/df)
 rm (/bin/rm)
 rndctl (/sbin/rndctl)
 awk (/usr/bin/awk)
 dirname (/usr/bin/dirname)
 stat (/usr/bin/stat)
 tail (/usr/bin/tail)

 All of the /usr/bin/* commands can be replaced by something else, 
 with a little work.

 --apb (Alan Barrett)

From: "Alan Barrett" <apb@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/47326 CVS commit: src/etc/rc.d
Date: Fri, 14 Dec 2012 18:42:26 +0000

 Module Name:	src
 Committed By:	apb
 Date:		Fri Dec 14 18:42:25 UTC 2012

 Modified Files:
 	src/etc/rc.d: random_seed

 Log Message:
 Avoid using programs from /usr/bin.  This should fix PR 47326.

 - no need for "dirname", because "df -G" can take a file name directly.
 - replace use of "awk" with a shell while read loop.
 - replace use of "stat -s" with "ls -ldn".
 - no need for "tail" now that the use of "stat" has changed.

 While here, also add some shell quotes and improve the grammar in a comment.


 To generate a diff of this commit:
 cvs rdiff -u -r1.3 -r1.4 src/etc/rc.d/random_seed

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

State-Changed-From-To: open->feedback
State-Changed-By: apb@NetBSD.org
State-Changed-When: Sat, 15 Dec 2012 07:26:07 +0000
State-Changed-Why:
Does revision 1.4 of src/etc/rc.d/random_seed solve the problem?


State-Changed-From-To: feedback->closed
State-Changed-By: wiz@NetBSD.org
State-Changed-When: Mon, 17 Dec 2012 10:27:49 +0000
State-Changed-Why:
Confirmed fixed, thanks for the feedback!


From: NAKAJIMA Yoshihiro <nakayosh@leto.eonet.ne.jp>
To: gnats-bugs@NetBSD.org, apb@NetBSD.org
Cc: gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: bin/47326 (/etc/rc.d/random_seed fails)
Date: Mon, 17 Dec 2012 19:26:27 +0900 (JST)

 On Sat, 15 Dec 2012 07:26:17 +0000 (UTC),
 apb@NetBSD.org wrote:

 > Synopsis: /etc/rc.d/random_seed fails
 > 
 > State-Changed-From-To: open->feedback
 > State-Changed-By: apb@NetBSD.org
 > State-Changed-When: Sat, 15 Dec 2012 07:26:07 +0000
 > State-Changed-Why:
 > Does revision 1.4 of src/etc/rc.d/random_seed solve the problem?

 It works.  thank you.

 -- 
 nakayosh

>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.