On Tue, Sep 03, 2002 at 01:21:19PM +0300, Peter Pentchev wrote:
> On Mon, Sep 02, 2002 at 06:35:24PM +0200, Paolo wrote:
> > Hi all!
> > I need to administer remotely a bunch of freebsd boxes. I would
> > be very useful to have access to the output of the rc scripts to see, for
> > example, if a cvsup session has worked correctly...
> > Is it there an option to force logging the output of the rc scripts?
> > Would it be useful if I started working on the subject?
>
> I believe that, in general, 'dmesg -a' should do what you want. A quick
> and easy solution, off the top of my head, would be to add an
> /usr/local/etc/rc.d/ZZZZZZZZ.savemessages.sh script, which does
> something like dmesg -a > /var/log/dmesg-afterboot.log or the like.
Actually, I think a nice feature of rcNG is being overlooked here. At work,
I deal with HP-UX machines (*ducks). When we write rc scripts for them, we
have to have four argument cases in the script:
* start - Run the actual command.
* stop - Stops the daemon/process/whatever
* start_msg - Outputs a single line description
* stop_msg - Outputs a single line description
For example:
case $1 in
start_msg)
echo "Start print spooler"
;;
stop_msg)
echo "Stop print spooler"
;;
'start')
...
;;
'stop')
...
;;
The end result of this is an /etc/rc.log generated by the rc scripts during
boot which looks something like this:
Start print spooler
Output from "/sbin/rc2.d/S720lp start":
----------------------------
scheduler is running
line printer scheduler started
Start clock daemon
Output from "/sbin/rc2.d/S730cron start":
----------------------------
cron started
Basically, rc.log consists of the (start|stop)_msg line, followed by the
name of the script that generated it, and then stdout/stderr of the actual
process run by the (start|stop) case. In the end, you end up with an
/etc/rc.log that shows the progress of your entire boot, and is finished
with:
**************************************************
HP-UX run-level transition completed
Fri Aug 30 20:11:56 CDT 2002
**************************************************
I'm not saying rcNG should have a (start|stop)_msg thing, but I would like
to see it log the output of stuff that it runs when booting and changing
runlevels.
--
Sean Kelly | PGP KeyID: 77042C7B
[EMAIL PROTECTED] | http://www.zombie.org
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message