liujie lv
liujie lv

Reputation: 11

using crontab to restart php-fpm will randomly only stop fpm

I use this configuration to restart php-fpm every 15 minutes, but after this script runs for 4-5 times, I've found that it sometimes only stops fpm, and does not start it again. This seems to occur randomly.

*/15 * * * * /etc/init.d/php-fpm stop && /etc/init.d/php-fpm start

or

*/15 * * * * /etc/init.d/php-fpm stop ; /etc/init.d/php-fpm start

So, is there a different way to restart fpm when calling it in a CRON job? What would be the correct way to call this restart?

Upvotes: 1

Views: 2256

Answers (1)

Justinas
Justinas

Reputation: 43441

Instead of running two commands run single restart

/etc/init.d/php-fpm restart

Upvotes: 1

Related Questions