I have a PHP
script that listens on a queue. Theoretically, it\'s never supposed to die. Is there something to check if it\'s still running? Something like
troelskn wrote:
Just append a second command after the script. When/if it stops, the second command is invoked. Eg.:
php daemon.php | mail -s "Daemon stopped" you@example.org
This will call mail
each time a line is printed in daemon.php (which should be never, but still.)
Instead, use the double ampersand operator to separate the commands, i.e.
php daemon.php & mail -s "Daemon stopped" you@example.org