Asri-unix.315
net.unix-wizards
utzoo!decvax!ucbvax!menlo70!sri-unix!wales@UCLA-Security
Sun Dec 27 10:39:50 1981
/etc/rc: stdin/stdout/stderr to /dev/console?
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

-----------------------------------------------------------------
gopher://quux.org/ conversion by John Goerzen <[email protected]>
of http://communication.ucsd.edu/A-News/


This Usenet Oldnews Archive
article may be copied and distributed freely, provided:

1. There is no money collected for the text(s) of the articles.

2. The following notice remains appended to each copy:

The Usenet Oldnews Archive: Compilation Copyright (C) 1981, 1996
Bruce Jones, Henry Spencer, David Wiseman.