Re: [PHP] Start/stop daemon using php

2008-02-27 Thread Jochem Maas
David Sveningsson schreef: Hi, I've written an application in c which I would like to start/stop as a daemon in gnu/linux. The application has the argument --daemon which forks the process and exits the parent. Then it setups a SIGQUIT signal handler to properly cleanup and terminate. It

Re: [PHP] Start/stop daemon using php

2008-02-27 Thread Per Jessen
David Sveningsson wrote: Hi, I've written an application in c which I would like to start/stop as a daemon in gnu/linux. The application has the argument --daemon which forks the process and exits the parent. Then it setups a SIGQUIT signal handler to properly cleanup and terminate. It

[PHP] Start/stop daemon using php

2008-02-27 Thread David Sveningsson
Hi, I've written an application in c which I would like to start/stop as a daemon in gnu/linux. The application has the argument --daemon which forks the process and exits the parent. Then it setups a SIGQUIT signal handler to properly cleanup and terminate. It also maintains a lockfile (with

Re: [PHP] Start/stop daemon using php

2008-02-27 Thread @4u
Hi, You might consider D-BUS for your application and the D-BUS PHP binding which is available since some days too. This would allow you to start / stop your C application in a far more secure way than the suggested one. Please have a look at my original release annoucement at the D-BUS mailing

Re: [PHP] Start/stop daemon using php

2008-02-27 Thread Daniel Brown
On Wed, Feb 27, 2008 at 7:51 AM, David Sveningsson [EMAIL PROTECTED] wrote: Hi, I've written an application in c which I would like to start/stop as a daemon in gnu/linux. The application has the argument --daemon which forks the process and exits the parent. Then it setups a SIGQUIT

Re: [PHP] Start/stop daemon using php

2008-02-27 Thread David Sveningsson
@4u skrev: Hi, You might consider D-BUS for your application and the D-BUS PHP binding which is available since some days too. This would allow you to start / stop your C application in a far more secure way than the suggested one. Please have a look at my original release annoucement at the

Re: [PHP] Start/stop daemon using php

2008-02-27 Thread David Sveningsson
Per Jessen skrev: David Sveningsson wrote: Hi, I've written an application in c which I would like to start/stop as a daemon in gnu/linux. The application has the argument --daemon which forks the process and exits the parent. Then it setups a SIGQUIT signal handler to properly cleanup and

Re: [PHP] Start/stop daemon using php

2008-02-27 Thread Per Jessen
David Sveningsson wrote: Per Jessen skrev: So obviously something is catching the SIGQUIT before it gets to your daemon. You mention a php site, so I take it you're running apache. In an apache process you then do an exec(something). I think apache is probably taking care of the SIGQUIT.