omg
omg

Reputation: 139832

how to make a PHP process auto-restart when dead?

Something like a daemon that will never die,

my system is fedora10

Upvotes: 0

Views: 1051

Answers (2)

Skaldrom Y. Sarg
Skaldrom Y. Sarg

Reputation: 164

Do you want to know how to construct such a service or just how to restart it in case of failure?

You could use something on system-level, like "monit": http://www.cyberciti.biz/tips/howto-monitor-and-restart-linux-unix-service.html

Upvotes: 0

phihag
phihag

Reputation: 287755

while true; do php daemon.php; done

If small outages are acceptable, add sleep 1; before done so that a continually failing daemon's spawn rate is somewhat limited.

Upvotes: 1

Related Questions