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

Posted Gnnnny

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了crond dead but pid file exists 问题解决办法相关的知识,希望对你有一定的参考价值。

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

查看crontab状态

1 [[email protected] var]# service crond status
2 crond dead but pid file exists

提示报错: crond dead but pid file exists

解决过程

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

尝试把进程文件删除掉

 1 [[email protected] 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 [[email protected] run]# rm -rf crond.pid 
11 [[email protected] run]# service crond status
12 crond dead but subsys locked

 

查看还是有该报错

然后,尝试重启crontab

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

解决方法

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

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

 

以上是关于crond dead but pid file exists 问题解决办法的主要内容,如果未能解决你的问题,请参考以下文章

salt-minion dead but pid file exists 正确解决方法

mysql无法启动ERROR! MySQL is running but PID file could not be found ?

MySQL is running but PID file could not be found

本地连接远程mysql服务报错:MySQL is running but PID file could not be found [FAILED]

本地连接远程mysql服务报错:MySQL is running but PID file could not be found [FAILED]

SyntaxError: Non-ASCII character ‘xe6‘ in file E:/pythondemo/example2.py on line 2, but no encoding(