From owner-freebsd-hackers Tue Sep 3 7:19:54 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DD43037B400 for ; Tue, 3 Sep 2002 07:19:50 -0700 (PDT) Received: from edgemaster.zombie.org (edgemaster.creighton.edu [147.134.112.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9C49043E6A for ; Tue, 3 Sep 2002 07:19:48 -0700 (PDT) (envelope-from smkelly@zombie.org) Received: by edgemaster.zombie.org (Postfix, from userid 1001) id 2820B66B04; Tue, 3 Sep 2002 09:19:47 -0500 (CDT) Date: Tue, 3 Sep 2002 09:19:47 -0500 From: Sean Kelly To: Peter Pentchev Cc: Paolo , freebsd-hackers@freebsd.org Subject: Re: to log the output of rc scripts Message-ID: <20020903141946.GA49976@edgemaster.zombie.org> References: <20020902183524.A69527@linux.netline.it> <20020903102119.GC39422@straylight.oblivion.bg> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020903102119.GC39422@straylight.oblivion.bg> User-Agent: Mutt/1.5.1i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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 smkelly@zombie.org | http://www.zombie.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message