/etc/rc: stdin/stdout/stderr to /dev/console?
utzoo!decvax!ucbvax!menlo70!sri-unix!wales at UCLA-Security
utzoo!decvax!ucbvax!menlo70!sri-unix!wales at UCLA-Security
Sun Dec 27 10:39:50 AEST 1981
From: wales at UCLA-Security (Rich Wales)
We are running 4.1bsd on VAXen. A perusal of the "init" code shows that,
just before invoking /etc/rc, files 0-2 (stdin, stdout, stderr) are opened
on the file "/" as follows:
open ("/", 0); dup (0); dup (0);
The reason for this is not immediately obvious to me.
(1) If the purpose is to close off input and output on /etc/rc, why not
open "/dev/null" instead of "/"?
(2) Processes forked from /etc/rc still appear to respond to the console.
For example, if I do a rubout during "fsck -p > /dev/console", the
"fsck" program goes away.
(3) Almost every line in /etc/rc has "> /dev/console" on it. Why not
simply set up /dev/console as the stdin/stdout/stderr of /etc/rc?
-- Rich
More information about the Comp.unix.wizards
mailing list