Am 30.04.2011 14:04, schrieb Ferenc Kovacs: > Hi. > > recently I found a nice blogpost about how to properly daemonize a php > daemon: > http://andytson.com/blog/2010/05/daemonising-a-php-cli-script-on-a-posix-system/ > I've noticed in this article, that you can replace/redirect the > STDIN/STDOUT/STDERR from inside of your script, you have to close them, and > open in the correct order. > It works (at least on linux), because the opened files will have the 1,2,3 > FDs, because the OS assign the lowest available FD, which will happen to be > the required ones
the cleaner way is to do this in a /etc/init.d/service-script we are running a monitoring-service written in php wilh a while(1==1) as linux-daemon since years and even config-changes are no problem with an internal counter for reloading them every 10 while-runs sleep(1) is a good idea fpr each run to make sure the daemon eats not too much ressources useless
signature.asc
Description: OpenPGP digital signature