What is the best way to keep a PHP script running as a daemon, and what\'s the best way to check if needs restarting.
I have some scripts that need to run 24/7 and f
We run our daemons by piping the output to mail.
php daemon.php | mail -s "daemon stopped" foo@example.org
That way, when/if the daemon stops, it will send a mail, and we will be notified that way.
It still means manual restart of the daemons of course, but we'll know right away. Usually, if the daemons stopped, it means that there is something else that needs to be taken care of anyway, so that's usually ok.