home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.jcu.edu.au
/
2014.06.ftp.jcu.edu.au.tar
/
ftp.jcu.edu.au
/
v6.3.2b
/
SWBD63
/
fabos-6.3.2b-10.ppc.rpm
/
fabos-6.3.2b.10.cpio.gz
/
fabos-6.3.2b.10.cpio
/
sbin
/
kmsghandler
< prev
next >
Wrap
Text File
|
2010-11-10
|
1KB
|
46 lines
#!/bin/sh
#
# Copyright (c) 2010 Brocade Communications Systems, Inc.
# All rights reserved.
#
# Check the kernel messages from syslogd and handle them accordingly.
#
#
# Finds out the pid of wdtd
#
wdtd_pid() {
/bin/ps -C wdtd -o pid=
}
#
# Handle the CF card error messages by setting a bootenv to indicate the
# error and killing the wdtd to trigger a reboot. It doesn't rely on the
# reboot command to reboot because it requires access to the CF card.
#
handle_badcf() {
echo "A fatal CF card failure has been detected. The system will" \
"be rebooted. Please contact your service provider for CF card" \
"replacement."
echo "Rebooting in 30 seconds!!!"
kill -n 9 $wdtd_pid
/sbin/bootenv CFCardState bad
}
wdtd_pid=$(wdtd_pid);
while read line
do
case "$line" in
(*hda*UncorrectableError*)
echo ---$line;
handle_badcf;;
(*hda*SectorIdNotFound*)
echo ---$line;
handle_badcf;;
(*hda*AddrMarkNotFound*)
echo ---$line;
handle_badcf;;
esac
done < /var/log/kmsg