Bug 15311 - keep more, larger syslog files if using /media/*/log/ directories
: keep more, larger syslog files if using /media/*/log/ directories
Status: CLOSED FIXED
Product: SB Touch
Classification: Unclassified
Component: OS
: 7.5.0
: All Other
: P2 normal (vote)
: 7.5.0
Assigned To: Vahid Fereydouny
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-12-15 21:51 UTC by Peter Watkins
Modified: 2010-04-08 17:25 UTC (History)
4 users (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Watkins 2009-12-15 21:51:32 UTC
fab4 PB2 currently running 7.5.0 r8224

I'm trying to track down a bug, but the syslog messages file is too chatty -- with the default setting of rotating every 1000 KB, I only get about 45 minutes of log data before it's rotated. The bug I'm looking at tends to occur after hours of idle/off time, so I need about 24 hours of log data.

I think /etc/init.d/rcS should be modified to write larger log files (10 MB) and keep more of them (9 backups rather than just 1) if using attached media. With SD cards typically holding between 2 and 16 GB, I think it's reasonable to expect that users can devote 100 MB (1 live file, 9 backups) to SqueezeOS logs.

I'd suggest changing this in rcS

# Start syslogd             
if [ -e /media/*/log ]; then
        # log and core files to media
        LOG_DIR=`echo /media/*/log`

        echo "Starting syslogd (to $LOG_DIR)"
        /sbin/syslogd -S -s1000 -O $LOG_DIR/messages

to something like

# Start syslogd             
if [ $(ls -d /media/*/log | wc -l) -gt 0 ]; then
        # log and core files to media
        LOG_DIR=`echo /media/*/log | head -1`

        echo "Starting syslogd (to $LOG_DIR)"
        /sbin/syslogd -S -s10240 -O $LOG_DIR/messages -b 9

(Note I'm also being more careful when setting LOG_DIR to ensure that only the first /media/*/log directory is used, and that the script's test won't choke if there are "log" directories on two different mounted media. I don't know if USB and SD are mounted before this runs, but it seems prudent to be more careful here.)

For the time being, I manually killed syslogd and spawned a new instance with the desired command line args.

Thanks.
Comment 1 Vahid Fereydouny 2010-02-23 17:17:18 UTC
The idea makes sense to me. If someone has created a log directory on their SD/USB cards then most likely they are interested in the log files and they have enough knowledge to track the potential problems. I will add the support.
Comment 2 Vahid Fereydouny 2010-02-24 14:47:57 UTC
With the current implementation of the syslogd in busybox it does not seem feasible to run multiple syslogd that function properly or redirecting the output to multiple files. Also it is not feasible to keep the older files in compressed format. I was hoping to find an easy way to persist the log files under all the devices that are interested in the logs including USB/SD. I will check in my changes that will redirect the logs to the first log directory that is found under /media if any available.
Comment 3 Vahid Fereydouny 2010-02-24 17:41:40 UTC
The maximum size that will be captured is 60MB to facilitate the potential capturing of the log files on the NAND flash.
Comment 4 Chris Owens 2010-04-08 17:25:37 UTC
This bug has been marked fixed in a released version of Squeezebox Server or the accompanying firmware or mysqueezebox.com release.

If you are still seeing this issue, please let us know!