Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

/etc/rc: stdin/stdout/stderr to /dev/console?

54 views
Skip to first unread message

ucbvax!unix-wizards

unread,
Dec 27, 1981, 6:42:30 AM12/27/81
to
>From wales@UCLA-Security Sun Dec 27 11:29:23 1981
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

0 new messages