因为突然发现,crontab 不能使用,
1、重启失败,并报 /var/run/crond.pid读写错误
[root@localhost raid]# service crond restart
Starting crond: crond: can't open or create /var/run/crond.pid: Input/output error
[FAILED]
2、ls 目录/var/run/crond.pid:显示有四个文件的读写错误,且touch /var/run/crond.pid 失败
[root@localhost raid]# ls /var/run.bak/
ls: cannot access /var/run.bak/crond.pid: Input/output error
ls: cannot access /var/run.bak/xinetd.pid: Input/output error
ls: cannot access /var/run.bak/atd.pid: Input/output error
ls: cannot access /var/run.bak/sshd.pid: Input/output error
abrt autofs-running faillock mcelog.pid pm-utils setrans
abrtd.pid certmonger hald mdadm portreserve sm-notify.pid
acpid.pid certmonger.pid haldaemon.pid memcached portreserve.pid sshd.pid
acpid.socket console httpd messagebus.pid rpcbind.lock syslogd.pid
atd.pid ConsoleKit ibacm.pid netreport rpcbind.pid udisks
auditd.pid crond.pid ipa_memcached net-snmp rpcbind.sock utmp
autofs.fifo-misc cups irqbalance.pid pki rpc.statd.pid winbindd
autofs.fifo-net cupsd.pid lvm pluto saslauthd xinetd.pid
autofs.pid dbus mcelog-client plymouth sepermit
3、备份文件夹 /var/run和/var/lock/subsys
[root@localhost raid]# mv /var/run /var/run.bak
[root@localhost raid]# mv /var/lock/subsys /var/lock/subsys.bak
4、恢复源文件
mkdir /var/run
mv /var/run.bak/ /var/run/*
[root@localhost raid]# mkdir /var/lock/subsys
[root@localhost raid]# mv /var/lock/subsys.bak/ /var/lock/subsys
5、touch crond.pid ,然后重启crond
[root@localhost raid]# service crond start
Starting crond: [ OK ]