NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/12311



The following reply was made to PR bin/12311; it has been noted by GNATS.

From: Miwa Susumu <miwarin%gmail.com@localhost>
To: gnats-bugs%NetBSD.org@localhost
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
 


Home | Main Index | Thread Index | Old Index