Re: How to see the output of a custom init script on Lenny?
On Thu, Jan 22, 2009 at 09:16:01AM +0100, Sander Marechal wrote:
> Ken Irving wrote:
> > On Wed, Jan 21, 2009 at 10:21:55PM +0100, Sander Marechal wrote:
> >> Is there nobody who knows how to show the stdout ouput of an init script
> >> during shutdown?
> > My guess is that the answer is "no".
> > Output should just show up on the console after you initiate shutdown
> > from there. Until the console itself goes away I don't see why output
> > from an init script would be handled differently from any other script.
> > Or perhaps you're assuming (but not stating) some other factors that
> > might have bearing on your question.
> I am starting to think that this has nothing to do with my custom init
> script but with my system as a whole. I don't see *any* output when I
> shot down or reboot. Only the red "Shutting down, please wait" message,
> but nothing after that. If I remove my custom init script then still no
> output of any of Debian's own init script is shown.
> Any ideas?
A red message? I missed the earlier part of the thread so don't know
what you're dealing with, but I suspect you must be in a gui environment,
and telling the system to shut down via a mouse click or something.
The obvious problem with messages during shutdown is that, however they're
shown, that medium is going to vanish, so you can't sit there and browse
them ala dmesg after the system's turned off.
The obvious solution is to tell your script to write those messages somewhere
that will survive shutdown and startup, e.g., your home directory, /var/tmp/,
etc. (well, /etc/ wouldn't be a great choice ;-). Don't use /tmp/ as that's
cleaned out by default on startup (I think; could be shutdown, maybe).
If you turn off your gui environment and shutdown from a console, e.g.,
hit Alt-F1 to go to tty1, then enter "sudo shutdown -h now" or similar,
then I would think you'd see some messages there.