How to run infinitely script in background on Linux?

Posted by Andrew Bashtannik on Stack Overflow See other posts from Stack Overflow or by Andrew Bashtannik
Published on 2010-03-23T10:46:39Z Indexed on 2010/03/23 10:53 UTC
Read the original article Hit count: 376

Filed under:
|

I have a PHP script with infinite loop. I need this script running forever. So, I run

php /path/to/script.php > /dev/null &

And it works in background in my current user's security context. But when I close terminal window (log off), of course, CentOS Linux kills my program.

I see two guesses: run from a different user in background or make a daemon. I need help in each situation.

Thanks a lot!

© Stack Overflow or respective owner

Related posts about linux

Related posts about infinite-loop