crond dead but pid file exists 问题解决办法


  之前写过一个定时关机的crontab,后来关掉之后发现还是每天定时关机

查看crontab状态

1 [root@puppetclient var]# service crond status
2 crond dead but pid file exists

提示报错: crond dead but pid file exists

解决过程

ps -ef | grep crond 以及把进程杀死 查看还是有该报错

尝试把进程文件删除掉

 1 [root@puppetclient var]# find -name cron*
 2 ./spool/anacron/cron.daily
 3 ./spool/anacron/cron.weekly
 4 ./spool/anacron/cron.monthly
 5 ./spool/cron
 6 ./lock/subsys/crond
 7 ./run/cron.reboot
 8 ./run/crond.pid
 9 
10 [root@puppetclient run]# rm -rf crond.pid 
11 [root@puppetclient run]# service crond status
12 crond dead but subsys locked

 

查看还是有该报错

然后,尝试重启crontab

1 [root@puppetclient run]# service crond restart
2 Starting crond:                                            [  OK  ]
3 [root@puppetclient run]# service crond status 
4 crond (pid  6131) is running...
5 [root@puppetclient run]# service crond stop
6 Stopping crond:                                            [  OK  ]
7 [root@puppetclient run]# service crond status
8 crond is stopped

解决方法

建议先尝试重启下查看是否还有该报错

如果还有的话 需要把进程文件删除掉

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM