How to use supervisord to run a PHP script as a daemon?
Posted
by
Alasdair
on Super User
See other posts from Super User
or by Alasdair
Published on 2012-03-21T04:26:04Z
Indexed on
2012/03/21
5:33 UTC
Read the original article
Hit count: 536
I need to have 8 threads of the same PHP script running in the background on a server continuously (as a daemon), and each script need to be automatically restarted if it exits for any reason.
I've been advised to use supervisord to do this, but I don't at all understand their documentation, which seems very complicated to me.
I also want each of the 8 threads of the script to be initially started at 2 minute intervals (2 minutes in between each launch) but then after this all 8 threads of the same PHP script should continue running on the server forever (and restarting if any exit for any reason).
Could someone please explain how to do this with supervisord, or any other easy way of doing it?
I'm on CentOS 6.
Thank you!
© Super User or respective owner