Trying to colour syslog-ng logs to ttyv7 but won't work after a reboot

Alex Zbyslaw xfb52 at dial.pipex.com
Thu Sep 15 08:24:20 PDT 2005


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



More information about the freebsd-questions mailing list