Subject: Re: rc.d boot log [was: Re: Cosmetic changes to rc.d scripts]
To: None <tech-userlevel@NetBSD.org>
From: David Young <dyoung@pobox.com>
List: tech-userlevel
Date: 10/13/2004 17:52:03
On Wed, Oct 13, 2004 at 01:34:57PM +0300, Mike M. Volokhov wrote:
> But it would be really good to have a boot log after restart. For
> example, it often needed to see if some services starts properly. There
> are situations when some rc.d/foo starts with incorrect (for example,
> syntax) errors and there are no way to see what happens, especially if
> this faulty service starts on remote server.

*snip snip*

> 
> I'm faced with this problem just yesterday and dirty hack it within
> following changes:
> 
> --- rc.orig	2004-10-13 13:04:37.000000000 +0300
> +++ rc	2004-10-13 13:05:07.000000000 +0300
> @@ -35,13 +35,20 @@
>  trap : INT
>  trap "echo 'Boot interrupted.'; exit 1" QUIT
>  
> -date
> +rclog date
>  
>  files=$(rcorder -s nostart ${rc_rcorder_flags} /etc/rc.d/*)
>  
>  for _rc_elem in $files; do
> -	run_rc_script $_rc_elem start
> +	rclog "run_rc_script $_rc_elem start"
>  done

I agree that this is a dirty hack. :-) It would not be easier and more
useful to start copying stdout/stderr to the log at the top of /etc/rc,
instead of adhockery scattered throughout the rc scripts?

Dave

-- 
David Young             OJC Technologies
dyoung@ojctech.com      Urbana, IL * (217) 278-3933