Article View: comp.sys.sun
Article #11821"Lost" /etc/rc* errors
From: Beau James
Date: Fri, 31 Mar 1989 01:47
Date: Fri, 31 Mar 1989 01:47
47 lines
2781 bytes
2781 bytes
Dianh Anderson writes (in part):
-- We ran into this very problem today. Our problem turned out to be an
-- error in rc.local. This caused the rpc.mountd and probably some other
-- key daemons not to be started at boot time. What happens is that an
-- error in rc.local can cause everything past that point in rc.local and
-- rc NOT to be executed. The SUN never mentions that it is having a
-- problem. We first noticed the automounter NOT starting at boot time and
-- then the client boot problem.
Silent failures from the /etc/rc* scripts have been a pet peeve of mine
for many years. I submitted my first bug report/RFE about this against
SunOS 0.9, and several times since then. The response was to add this
comment to the scripts:
# Note that all "echo" commands are in parentheses. This is done
# because all commands that redirect the output to "/dev/console"
# must be done in a child of the main shell, so that the main shell
# does not open a terminal and get its process group set. Since
# "echo" is a builtin command, redirection for it will be done
# in the main shell unless the command is run in a subshell.
which misses the point entirely (and fails to explain why getting the
shell's process group set is a bad idea!).
As far as I am aware, the only reason for all this avoidance is to prevent
the startup scripts from being interruptable - so that you can't type "^C"
to interrupt or "^\" to core dump the main shell.
I'm not sure why that's a big win. But if it really is desirable, then
the right approach should have been to run each command in a subshell,
with BOTH stdout and stderr redirected to the console.
There is a simpler fix for the silent failure syndrome. Place the line
exec > /dev/console 2>&1
at the beginning of /etc/rc and /etc/rc.boot. That will redirect both
stdout and stderr to the console, for the "main shell" and for each of the
commnands run from the main shell.
Once you add that line, you will also want to comment out the rc* lines
that are wrong for your configuration (e.g. "ifconfig ec0 ..." on a
machine with an "ie" interface) to avoid unnecessary error messages.
Beau James beau@ultra.com
Ultra Network Technologies sun!ames!ultra!beau
Technical Details
Message-ID:
<8903170337.AA04376@hal.ultra.Ultra.COM>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!husc6!rice!sun-spots-requestShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!husc6!rice!sun-spots-request From: ultra!beau@ames.arc.nasa.gov (Beau James) Newsgroups: comp.sys.sun Subject: "Lost" /etc/rc* errors Keywords: SunOS Message-ID: <8903170337.AA04376@hal.ultra.Ultra.COM> Date: 31 Mar 89 01:47:04 GMT Sender: usenet@rice.edu Organization: Sun-Spots Lines: 47 Approved: Sun-Spots@rice.edu Original-Date: Thu, 16 Mar 89 19:37:16 PST X-Sun-Spots-Digest: Volume 7, Issue 217, message 10 of 11