What's new

How do I capture log events from before a crash on AC66?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

e94mli

New Around Here
Is there a way on a rt-ac66 to get the log events from before a crash reboot? Seems log is only stored in ram by default. Was hoping to get a clue to why it reboots.
 
You can't. Kernel oops messages aren't logged in Syslog, you need a serial cable to capture that output.
 
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?
 
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.
 
No because the syslog is stored on a ramdisk (/tmp) and is saved to only /jffs on clean reboots etc.

That is what I was afraid of. Well I'm going to try the external syslog option, which I just discovered, not as good but much better than nothing. :)
 
You could save the syslog on an attached USB drive instead of in RAM. It may be different for the AC66, but this is how I do it for my N66U (modify to suit your situation).

/jffs/scripts/post-mount :

Code:
#!/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
 
why not just restart syslogd and point it to a thumbdrive same for klogd

klogd should capture most of the kernel messages, but not those that cause the crash, if it's crashed, it's not going to log anything

edit: collin beat me to it, but why not add klogd as well since he wants kernel messages
 
Since I'm only doing this for debugging I skipped the script and just killed syslogd and started it again pointing to the flash drive. I also restarted klogd to be on the safe side. Remote syslog didn't give any hints hopefully this will. Thanks for the help.
 
that's correct
but both syslogd and klogd should be killed then restarted
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.
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top