[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Logging Init output?



On Fri, Jun 22, 2001 at 10:28:59AM +0200, Mart van de Wege wrote:
> Thanks for the tip with shift-pageup. I do know about that but I keep
> forgetting it. I don't know if it goes back far enough for my purposes,
> but I'll give it a shot next time. For the record though, I wasn't talking
> about the kernel boot messages, which is what dmesg returns, but about the
> init messages, which to my scant knowledge aren't logged anywhere.

The output of sysvinit scripts is sent to standard output and any errors
that occur are naturally sent to standard error.  Maybe it would be a nice
feature indeed to have all these messages sent to syslog for the record.
You could submit a wishlist bug about that against sysvinit.

In your case, which is really about debugging some particular problem
in one of the init scripts, don't be afraid to hack a little on some of
these sysvinit scripts.  They are the files in /etc/init.d and they're
supposed to by modifyable by the local admin (that's why they're in
/etc and not in /usr/lib).  You can simply put in some extra "echo's"
and if you want the script to pause at some point, put in "read dummy"
and the shell will stop at that point to read input from standard input
(the console in this case) into the variable "dummy" (be careful that the
script you're hacking didn't accidentally already use that variable :-) ).

If you are unsure about your editing of these system files, just make
a backup with .orig appended onto the filename.

Now you should find the proceeding of things during boot time more clear.
If not, just hack a bit more :-)

If you happen to succeed in making the sysvinit boot system crap out
(this should be really hard to make happen though) due to bad code in
some of your edits:  You can aways boot your linux with "init=/bin/bash"
appended on the lilo prompt.  That way, regular /sbin/init will not
be started and the sysvinit scripts are skipped altogether.  In fact
if you boot with a different init, you may not even get to see login,
just a bare root prompt.  Which is why console access to a machine forms
a security risk, unless you carefull tune some things (like turning of
the default handler for ctrl-alt-del - in /etc/inittab iirc).

man init
man inittab
and maybe
man run-parts

Cheers,


Joost



Reply to: