Subject: Re: bin/21658: interrupting (^C) /etc/rc.d/fsck doesn't stop auto boot
To: ITOH Yasufumi <itohy@netbsd.org>
From: Todd Vierling <tv@pobox.com>
List: netbsd-bugs
Date: 05/27/2003 09:52:40
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.)
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.
--
-- Todd Vierling <tv@pobox.com>