Is possible to capture any of the syslog from before a crash in case there is any indication of errors before the actual kernel crash?
No because the syslog is stored on a ramdisk (/tmp) and is saved to only /jffs on clean reboots etc.
#!/bin/sh
logger -t $(basename $0) $1
if [ $1 = "/tmp/mnt/VERBATIM" ]
then
logger -t $(basename $0) "Moving syslog"
LOGFILE=$1/syslog.log
killall syslogd
cat /tmp/syslog.log >> $LOGFILE
syslogd -m 0 -S -O $LOGFILE -s 200 -l 7
mv /tmp/syslog.log /tmp/syslog.old
ln -s $LOGFILE /tmp/syslog.log
fi
I could be wrong but I understood that klogd sends it's messages through syslogd by default.edit: collin beat me to it, but why not add klogd as well since he wants kernel messages
I could be wrong but I understood that klogd sends it's messages through syslogd by default.
It's doesn't seem to be required (although it's probably good practice). Looking a busybox's klogd.c, it just uses syslog() to write its messages so I don't see it being a problem.that's correct
but both syslogd and klogd should be killed then restarted
Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!