NetBSD Problem Report #12311

Received: (qmail 11372 invoked from network); 2 Mar 2001 03:08:42 -0000
Message-Id: <200103020319.f223J7a13741@polaris.garbled.net>
Date: Thu, 1 Mar 2001 20:19:07 -0700 (MST)
From: Tim Rightnour <root@polaris.garbled.net>
Reply-To: root@polaris.garbled.net
To: gnats-bugs@gnats.netbsd.org
Subject: machine does not abort boot if /usr fails to mount
X-Send-Pr-Version: 3.95

>Number:         12311
>Category:       bin
>Synopsis:       machine does not abort boot if /usr fails to mount
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Mar 02 03:09:01 +0000 2001
>Closed-Date:    
>Last-Modified:  Tue May 31 04:30:01 +0000 2016
>Originator:     Tim Rightnour
>Release:        20010301
>Organization:

>Environment:

System: NetBSD polaris 1.5_ALPHA2 NetBSD 1.5_ALPHA2 (POLARIS) #1: Wed Dec 13 00:45:28 MST 2000 root@polaris:/usr/src/sys/arch/i386/compile/POLARIS i386


>Description:
If machine fails to mount /usr for some reason, say for example there is
no /usr directory in /, then the machine will continue along as if
nothing were wrong, and fail miserably to come up.  In addition, it will
generally try to spawn gettys on the console, and not allow you in.

>How-To-Repeat:
umount /usr
rm -rf /usr
reboot
cry


>Fix:
Check the return code of the mount calls later in the boot process.

>Release-Note:
>Audit-Trail:
From: Jeff Rizzo <riz@tastylime.net>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: bin/12311
Date: Wed, 11 Jan 2012 09:18:29 -0800

 This still applies, tested with NetBSD-5.1:

 lots of: Jan 11 17:18:01 init: can't exec getty `/usr/libexec/getty' for 
 port `/dev/ttyE3': No such file or directory
 Jan 11 17:18:01 init: can't exec getty `/usr/libexec/getty' for port 
 `/dev/ttyE1': No such file or directory
 Jan 11 17:18:01 init: can't exec getty `/usr/libexec/getty' for port 
 `/dev/ttyE2': No such file or directory


 ...but no love.

From: Miwa Susumu <miwarin@gmail.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/12311
Date: Tue, 30 Dec 2014 16:35:23 +0900

 If it fails to tty setting moves to single user mode.
 I want to change the sbin/init/init.c

 <<< from here
 --- init.c.orig    2014-12-30 16:16:24.000000000 +0900
 +++ init.c    2014-12-30 16:15:58.000000000 +0900
 @@ -1502,10 +1502,16 @@
          add_session(sp);
      }

 -    while (!requested_transition)
 -        if ((pid = waitpid(-1, &status, 0)) != -1)
 +    while (!requested_transition) {
 +        if ((pid = waitpid(-1, &status, 0)) != -1) {
              collect_child(pid, status);
 -
 +            if(WEXITSTATUS(status)) {
 +                warning("can't setting tty. goto single user mode");
 +                requested_transition = death;
 +            }
 +        }
 +    }
 +
      return (state_func_t)requested_transition;
  }
 >>> to here

 I thought some of the proposed measures.
 I was determined that it is reasonable to processing in multi_user().

 1. check mount state?
 => reject. It is not possible to check if the partition is / only no.

 2. check directory exists?
 => reject. Do enough of it which directory is present ?

 3. It would be a problem that multi_user() to endless loop.
 => Transition to single-user mode, user is to recover.

 By the way, FreeBSD also same behavior (init to endless loop)

 -- 
 miwarin

From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: bin/12311: machine does not abort boot if /usr fails to mount
Date: Mon, 30 May 2016 05:12:10 +0000

 I don't think that patch to init will work (it would have to be able
 to distinguish between problems starting up getty and a session
 exiting with an error later on, at a minimum) and anyway ISTM that the
 right way to do this is to have the rc(8) system abort if critical
 filesystems fail to mount.

 -- 
 David A. Holland
 dholland@netbsd.org

From: christos@zoulas.com (Christos Zoulas)
To: gnats-bugs@NetBSD.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, 
	root@polaris.garbled.net
Cc: 
Subject: Re: bin/12311: machine does not abort boot if /usr fails to mount
Date: Mon, 30 May 2016 10:16:07 -0400

 On May 30,  5:15am, dholland-bugs@netbsd.org (David Holland) wrote:
 -- Subject: Re: bin/12311: machine does not abort boot if /usr fails to mount


 Solving this requires AI. For example you can test if /usr/libexec/getty
 exists and refuse to go multi-user if it does not, but what about other
 kinds of problems that would prevent getty to run? Also putting this kind
 of logic in init goes against POLA. I suggest that we close this by saying
 you can always reboot to single user.

 christos

From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/12311: machine does not abort boot if /usr fails to mount
Date: Tue, 31 May 2016 04:28:30 +0000

 On Mon, May 30, 2016 at 02:20:01PM +0000, Christos Zoulas wrote:
  >  Solving this requires AI. For example you can test if /usr/libexec/getty
  >  exists and refuse to go multi-user if it does not, but what about other
  >  kinds of problems that would prevent getty to run? Also putting this kind
  >  of logic in init goes against POLA. I suggest that we close this by saying
  >  you can always reboot to single user.

 Why? If /usr is a mounted fs and the mount fails, dropping to single
 user is a rational response. (Same as if fsck on / fails.)

 There's a list of critical filesystems (actually more than one) in
 rc.conf; we can in principle use that information to know which mount
 failures matter. It's not entirely trivial as it either requires
 passing the info into mount -a or rehashing parts of mount -a outside
 of mount, but it's certainly doable.

 Definitely doesn't belong in init though...

 -- 
 David A. Holland
 dholland@netbsd.org

>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-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.