[net.unix-wizards] redirecting stdout in /etc/rc

Robert_Toxen%anvil.UUCP@harvard.harvard.edu (04/15/86)

> From: rs%mirror.uucp@BRL.ARPA
> Subject: Redirection in /etc/rc* in 4.2
> Date: 28 Mar 86 21:12:00 GMT
> 
> I sent this out once before, but I don't think it made it out
> the door....
> 
>     In BSD4.2, is there any good reason why /etc/rc shouldn't
>-    have an "exec >/dev/console 2>1" at the top, and punt all
>+    have an "exec >/dev/console 2>&1" at the top, and punt all
>     those line-by-line redirections throughout it and rc.local?
> 
> --
> Rich $alz	{mit-eddie, ihnp4!inmet, wjh12, cca, datacube}!mirror!rs
> Mirror Systems	2067 Massachusetts Avenue  Cambridge, MA, 02140
> Telephone:	6,176,610,777

I doubt there is any reason not to do it. We did essentially the same thing
for the Onyx System III port. Note that I added an ampersand (&) which is
needed.

Note that it is a common error in UNIX ports to forget to redirect stderr
(particularly for fsck) in /etc/rc from its default of essentially /dev/null.

Bob Toxen
Stratus Computer
{ucbvax!ihnp4,harvard}!anvil!bob
============================

jerry@oliveb.UUCP (Jerry Aguirre) (04/19/86)

If you redirect output from /etc/rc to the console then the console
becomes the "controlling tty" for all processes spawned by /etc/rc.
(Cron, net daemons, etc.) This is probably undesirable.

Redirecting output of specific programs is OK depending on the program.

					Jerry Aguirre @ Olivetti ATC
{hplabs|fortune|idi|ihnp4|tolerant|allegra|glacier|olhqma}!oliveb!jerry