使用crontab重启php-fpm将随机停止fpm
问题描述:
我使用这个配置每15分钟重新启动php-fpm
,但是在这个脚本运行4-5次之后,我发现它有时只会停止fpm,不要重新开始。这似乎是随机发生的。使用crontab重启php-fpm将随机停止fpm
*/15 * * * * /etc/init.d/php-fpm stop && /etc/init.d/php-fpm start
或
*/15 * * * * /etc/init.d/php-fpm stop ; /etc/init.d/php-fpm start
那么,有没有一种不同的方式在一个cron作业,调用它时重新启动fpm
?什么是正确的方式来调用此重新启动?
答
,而不是运行两个命令的运行单一restart
/etc/init.d/php-fpm restart
事实上,我在第一次使用重新启动命令,但它还是发生了 –