Re: daemon without pcntl_fork
| From: | Per Jessen | Date: | Tue, 18 Aug 2009 08:07:40 +0000 |
| Subject: | Re: daemon without pcntl_fork | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-296911@lists.php.net to get a copy of this message | ||
Jim Lucas wrote:
> Does anybody know how to use PHP as a daemon without the use of
> pcntl_fork.
>
Sure. Just start it and leave it running.
> I want to launch a daemon out of the /etc/rc.local when the system
> starts.
Yep, I do that all the time.
> Anybody have any idea on how to do this?
On an openSUSE system I would just use 'startproc', but elsewhere you
could use setsid or nohup. I.e. create your CLI script with a
hash-bang, then start it
nohup <script> 2>&1 1>/dev/null &
/Per
--
Per Jessen, Zürich (21.6°C)