2011年1月27日 星期四

mcelog: warning: record length longer than expected. Consider update.

常常會收到系統寄來的信
You have new mail in /var/spool/mail/root

而內容大部分是

/etc/cron.hourly/mcelog.cron:

mcelog: warning: record length longer than expected. Consider update.

發現是mcelog的問題

mcelog reports incorrect record size
http://elrepo.org/tiki/kernel-ml

Only 64-bit systems are affected. The userland tool needs to be revised to
distinguish between the mcelog record size of a distro kernel and a more
modern kernel. As a work-around to avoid hourly e-mail messsages from the
cron daemon, you can append 2>&1 to the last line of the
/etc/cron.hourly/mcelog.cron file.

See also: RHbz #507026 mcelog: warning: record length longer than expected.
(external link)
https://bugzilla.redhat.com/show_bug.cgi?id=507026


所以只要在/etc/cron.hourly/mcelog.cron這個檔案 最後一行加上2>&1就可以了

/usr/sbin/mcelog --ignorenodev --filter >> /var/log/mcelog 2>&1

2 為Console標準錯誤STDERR
1 為Console標準輸出STDOUT

STDIN,STDOUT,STDERR 即:0,1,2

2>&1 就是把 標準錯誤 重新導向到 標準輸出

參考
http://www.linuxsir.org/bbs/showthread.php?t=40501
http://www.ningoo.net/html/2007/shell_scripts_stderr_stdout.html

沒有留言:

張貼留言