Welcome! Log In Create A New Profile

Advanced

running fpm 0.6 in non-daemon mode?

Posted by henrik 
henrik
running fpm 0.6 in non-daemon mode?
October 21, 2009 12:40PM
hello,

i used php 5.3.0 with fpm-0.5.12 together with supervisord which
requires the process to stay in foreground and not to detach from the
console. this was working with the "--fpm" switch:

/usr/bin/php-cgi --fpm --fpm-config /etc/php5/cgi/php-fpm.conf

but in version 0.6 this does not work anymore, is there an option for
the new php-fpm binary that will prevent the detach?
Juan Fco. Giordana
Re: running fpm 0.6 in non-daemon mode?
October 21, 2009 01:04PM
henrik wrote:
> hello,
>
> i used php 5.3.0 with fpm-0.5.12 together with supervisord which
> requires the process to stay in foreground and not to detach from the
> console. this was working with the "--fpm" switch:
>
> /usr/bin/php-cgi --fpm --fpm-config /etc/php5/cgi/php-fpm.conf
>
> but in version 0.6 this does not work anymore, is there an option for
> the new php-fpm binary that will prevent the detach?

Hello Henrik,

This is what I use for daemontools:

~ $ cat /var/supervise/php-fpm/run
#! /bin/sh -

exec 2>&1
exec /usr/local/bin/php-fpm --fpm-config \
/usr/local/etc/php-fpm/php-fpm.conf


Notice that the binary is now php-fpm and not php-cgi. Make sure to
follow the instructions given by dreamcat4 here:

http://github.com/dreamcat4/php-fpm

Regards
henrik
Re: running fpm 0.6 in non-daemon mode?
October 22, 2009 03:28AM
hi juan,

i tested your start script but it also forks into background :-(
i forgot to mention that i am using the integrated install method.
maybe this is the reason, i will try the seperate method and then test
your script again with the new binary.

thanks!

> Hello Henrik,
>
> This is what I use for daemontools:
>
> ~ $ cat /var/supervise/php-fpm/run
> #! /bin/sh -
>
> exec 2>&1
> exec /usr/local/bin/php-fpm --fpm-config \
> /usr/local/etc/php-fpm/php-fpm.conf
>
> Notice that the binary is now php-fpm and not php-cgi. Make sure to
> follow the instructions given by dreamcat4 here:
>
> http://github.com/dreamcat4/php-fpm
>
> Regards
Re: running fpm 0.6 in non-daemon mode?
October 22, 2009 07:18AM
Don't bother,

The reason is there's no daemon mode period. We have seen changes
between 0.5 and 0.6 in the cgi/cgi_main.c. Im not sure exactly why
Andrei decided to take the non-daemon mode out specifically, but it
was with a general re-organisation of the command line options. If you
know C, you could probably put the feature back (as a non-default
switch) in without too much efforts,

Otherwise must roll back to 0.5x.

On Thu, Oct 22, 2009 at 8:27 AM, henrik <henrik.westphal@gmail.com> wrote:
>
> hi juan,
>
> i tested your start script but it also forks into background :-(
> i forgot to mention that i am using the integrated install method.
> maybe this is the reason, i will try the seperate method and then test
> your script again with the new binary.
>
> thanks!
>
>> Hello Henrik,
>>
>> This is what I use for daemontools:
>>
>> ~ $ cat /var/supervise/php-fpm/run
>> #! /bin/sh -
>>
>> exec 2>&1
>> exec /usr/local/bin/php-fpm --fpm-config \
>> /usr/local/etc/php-fpm/php-fpm.conf
>>
>> Notice that the binary is now php-fpm and not php-cgi. Make sure to
>> follow the instructions given by dreamcat4 here:
>>
>> http://github.com/dreamcat4/php-fpm
>>
>> Regards
>
Juan Fco. Giordana
Re: running fpm 0.6 in non-daemon mode?
October 22, 2009 05:06PM
dreamcat four wrote:
> Don't bother,
>
> The reason is there's no daemon mode period. We have seen changes
> between 0.5 and 0.6 in the cgi/cgi_main.c. Im not sure exactly why
> Andrei decided to take the non-daemon mode out specifically, but it
> was with a general re-organisation of the command line options. If you
> know C, you could probably put the feature back (as a non-default
> switch) in without too much efforts,
>
> Otherwise must roll back to 0.5x.

I'm using php-fpm-0.6-5.3.1 and it works OK.
steven.hartland
Re: running fpm 0.6 in non-daemon mode?
October 22, 2009 06:06PM
What about the config variable:
<value name="daemonize">yes</value>
Re: running fpm 0.6 in non-daemon mode?
October 22, 2009 06:06PM
Hi,
Im sorry but I have just tried this and get the same result as henrik
did. Using exec doesn't to anything either from a script or on the
command line. Are you sure it might not be something special that
DaemonTools is doing? We expect FPM is forking away to background.
Thats for any 0.6 including 0.6-5.3.1.

Best regards,

dreamcat4
dreamcat4@gmail.com

On Thu, Oct 22, 2009 at 7:05 PM, Juan Fco. Giordana
<juangiordana@gmail.com> wrote:
>
> dreamcat four wrote:
>>
>> Don't bother,
>>
>> The reason is there's no daemon mode period. We have seen changes
>> between 0.5 and 0.6 in the cgi/cgi_main.c. Im not sure exactly why
>> Andrei decided to take the non-daemon mode out specifically, but it
>> was with a general re-organisation of the command line options. If you
>> know C, you could probably put the feature back (as a non-default
>> switch) in without too much efforts,
>>
>> Otherwise must roll back to 0.5x.
>
> I'm using php-fpm-0.6-5.3.1 and it works OK.
>
Re: running fpm 0.6 in non-daemon mode?
October 22, 2009 06:08PM
Ah !
I think we all forgot about that. Problem solved.

On Thu, Oct 22, 2009 at 11:04 PM, steven.hartland
<steven.hartland@multiplay.co.uk> wrote:
>
> What about the config variable:
> <value name="daemonize">yes</value>
Re: running fpm 0.6 in non-daemon mode?
October 22, 2009 06:20PM
On Thu, Oct 22, 2009 at 11:04 PM, steven.hartland
<steven.hartland@multiplay.co.uk> wrote:
>
> What about the config variable:
> <value name="daemonize">yes</value>

Come to think about it, theres several such frequently needed
configuration switches and aren't obvious enough. There should be an
appropriate discussion in the man page. Does anybody here like to use
the supplied man page? It could be improved upon for next release.

dreamcat4
dreamcat4@gmail.com
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 296
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready