You are here: Re: Daemonising to continue asynchronously « PHP Programming Language « IT news, forums, messages
Re: Daemonising to continue asynchronously

Posted by Andy Jeffries on 04/25/06 01:24

On Mon, 24 Apr 2006 14:45:34 -0700, fletch wrote:
>> For anyone interested, a working function to become a Daemon (background
>> task, unattached from the parent process) from a PHP CLI script is:
>
> <sinp code>
>
> this is useful code but I would like to point out that a daemon should
> automatically restart when it dies unexpectedly, and ensure that only one
> instance is running, not covering these cases is usally a bad thing. It
> depends what the daemon does of course.

Absolutely, daemon probably isn't the right word, fully detached process
would probably be better.

Although Apache is a daemon, but if the main apache process dies then it
won't automatically restart by itself will it (it relies on
start-stop-daemon or the like).

Anyway, thought the code may help someone in the future.

Cheers,


Andy

--
Andy Jeffries MBCS CITP ZCE | gPHPEdit Lead Developer
http://www.gphpedit.org | PHP editor for Gnome 2
http://www.andyjeffries.co.uk | Personal site and photos

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация