Subject: Re: bin/21658: interrupting (^C) /etc/rc.d/fsck doesn't stop auto boot
To: Todd Vierling <>
From: Luke Mewburn <>
List: netbsd-bugs
Date: 05/28/2003 21:36:42
On Tue, May 27, 2003 at 09:52:40AM -0400, Todd Vierling wrote:
  | On Mon, 26 May 2003, ITOH Yasufumi wrote:
  | : The forked sh and /sbin/fsck doesn't handle/block/ignore SIGINT,
  | : and if ^C is pressed,
  | :
  | : sh /etc/rc (handle ^C) - forked sh - /sbin/fsck - /sbin/fsck_ffs (handle ^C)
  | :         |                   |           |              |
  | :         v                   v           v              v
  | : handle ^C and ignore       die         die        handle ^C and exit 12
  | What may also be missing here is a hook in rc.subr:run_rc_script() to exit
  | if the forked sh dies (test $? -ne 0).  Right now, the forked sh's exit code
  | is ignored, hence stop_boot() in /etc/rc.d/fsck doesn't do a thing to the
  | parent /etc/rc shell.  (The "kill" in /etc/rc.d/fsck is ineffective; it
  | kills the /etc/rc.d/fsck subshell but *not* its parent.)

Weird; I'm sure I tested the stop_boot() stuff a fair bit, both in
"standard" config and with rc_fast_and_loose=YES.  (Don't forget that
it won't work from single->multi user boots, only direct-to-multiuser

That said, it wouldn't be that hard to put in some code to test this

  | lukem, do you think this is useful?  I don't think that this will cause rc
  | to abort if any random command invoked by a rc.d script fails (since by
  | default, commands called by rc.d scripts also have their exitcodes ignored).
  | This could be used to cause rc to abort if a rc.d script explicitly exits
  | with a nonzero return code.

Could be a good idea; I'll take a look.  (If you get a chance to test
& prove your theory before I commit any fixes, feel free to let me
know, preferably with a patch containing a working fix ;-)