From owner-freebsd-questions@FreeBSD.ORG Thu Sep 15 15:24:19 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E6FEC16A41F for ; Thu, 15 Sep 2005 15:24:19 +0000 (GMT) (envelope-from xfb52@dial.pipex.com) Received: from smtp-out2.blueyonder.co.uk (smtp-out2.blueyonder.co.uk [195.188.213.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3932743D46 for ; Thu, 15 Sep 2005 15:24:16 +0000 (GMT) (envelope-from xfb52@dial.pipex.com) Received: from [80.192.58.55] ([80.192.58.55]) by smtp-out2.blueyonder.co.uk with Microsoft SMTPSVC(5.0.2195.6713); Thu, 15 Sep 2005 16:25:04 +0100 Message-ID: <4329921F.2070006@dial.pipex.com> Date: Thu, 15 Sep 2005 16:24:15 +0100 From: Alex Zbyslaw User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-GB; rv:1.7.11) Gecko/20050903 X-Accept-Language: en-us, pl MIME-Version: 1.0 To: Ashley Moran References: <43298076.7050705@codeweavers.net> In-Reply-To: <43298076.7050705@codeweavers.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 15 Sep 2005 15:25:04.0905 (UTC) FILETIME=[A5CC9F90:01C5BA09] Cc: freebsd-questions@freebsd.org Subject: Re: Trying to colour syslog-ng logs to ttyv7 but won't work after a reboot X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Sep 2005 15:24:20 -0000 Ashley Moran wrote: > I have a 5.4-STABLE server that I've reconfigured to use syslog-ng > instead of syslogd. It collects logs from all our servers and sorts > them into per-host folders. > > Our network admin showed me his gentoo machine earlier which uses ccze > to colour log files as they scroll up the screen. He wanted a > high-res display with our whole network's logs scrolling in the > background (as much for the geek-porn factor as the usefulness). > > After a lot of hacking and patching I managed to get the machine > running 1024x768. I installed ccze, then modified syslog-ng.conf to > use it as a destination: > > destination term { program("ccze -r > /dev/ttyv7"); }; > > I set syslog-ng to log all remote logs to this destination, and after > re-starting syslog-ng to reload the config, it worked fine. However, > for some reason way beyond me, it *will not work* after a reboot. I > have to restart syslog-ng after a reboot before it will log to the > virtual terminal. > > Here is the startup script I created in /usr/local/etc/rc.d/syslog-ng.sh: > > (the mountcritremote and cleanvar requirements I copied from the > syslogd file - I assume I want devfs to access /dev/ttyv7) > > #!/bin/sh > # > > # PROVIDE: syslogng > # REQUIRE: devfs mountcritremote cleanvar > # BEFORE: SERVERS > > . /etc/rc.subr > > name="syslogng" > rcvar=`set_rcvar` > required_files="/usr/local/etc/syslog-ng/syslog-ng.conf" > command="/usr/local/sbin/syslog-ng" > > load_rc_config $name > run_rc_command "$1" > > > > Maybe this is some subtle quirk of the boot process that I haven't > understood. Can anybody help? > The requirements like BEFORE: SERVERS are not honoured by scripts in /usr/local/etc/rc.d. Try placing the script in /etc/rc.d calling it say syslogng (i.e. without the .sh). man rc has more info, as would scanning back through the freebsd-rc archives. I believe that work to make scripts in /usr/local/etc/rc.d work more like system scripts will appear sometime in 6.X, though full integration is, I believe, not expected until 7.X. Right now, your syslogng will be being started *after* lots of servers that might expect to talk to it. I assume you put syslogng_enable="YES" into /etc/rc.conf? as well as syslogd_enable="NO". (Or, it might work just to change syslogd_program="/path/to/syslogngd" and not bother with changing anything else). --Alex