系统用户root接到邮件:
From Fri Apr 30 16:01:02 2010
Date: Fri, 30 Apr 2010 16:01:02 +0800
From: (Cron Daemon)
To:
Subject: Cron <> run-parts /etc/cron.hourly
Content-Type: text/plain; charset=ISO-8859-1
Auto-Submitted: auto-generated
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
/etc/cron.hourly/mcelog.cron:
mcelog: Cannot open /dev/mem for DMI decoding: No such file or directory
字符文件/dev/mem丢失了。
处理方法:
1、查到/dev/mem的主次设备号
#cat /proc/devices |grep -3 mem
Character devices:
1 mem
4 /dev/vc/0
4 tty
4 ttyS
2、从别的机器看到/dev/mem的权限
#ll /dev/mem
crw-r----- 1 root kmem 1, 1 03-12 23:03 /dev/mem
3、创建字符设备
# mknod -m 640 /dev/mem c 1 1
# ll /dev/mem
crw-r----- 1 root root 1, 1 04-30 18:26 /dev/mem
4、验证
#rm -f /dev/mem
#cat /etc/cron.hourly/mcelog.cron
#!/bin/bash
if [ -e /proc/xen ] && [ `cat /sys/hypervisor/uuid` != "00000000-0000-0000-0000-000000000000" ]; then
# this is a PV Xen guest. Do not run mcelog.
exit 1;
else
/usr/sbin/mcelog --ignorenodev --filter >> /var/log/mcelog
fi
#/usr/sbin/mcelog --ignorenodev --filter >> /var/log/mcelog
mcelog: Cannot open /dev/mem for DMI decoding: No such file or directory
#mknod -m 640 /dev/mem c 1 1
#/usr/sbin/mcelog --ignorenodev --filter >> /var/log/mcelog
返回成功。
阅读(1905) | 评论(0) | 转发(0) |