Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Aug 2011 21:52:58 +0200
From:      Rainer Schwarze <rsc@admadic.de>
To:        freebsd-ports@freebsd.org
Subject:   Re: lighttpd/moinmoin/fastcgi: child exited with status 127 - update
Message-ID:  <4E45849A.8090300@admadic.de>
In-Reply-To: <4E44394E.1050605@admadic.de>
References:  <4E42F7BD.4000105@admadic.de>	<20110811013130.GF262@magic.hamla.org>	<4E438787.4050503@admadic.de>	<CAHcdu2pHdtS5rNW6JPDx5jVDZ6zwj4a-ZnWL2Z4Q_teQt5YmoQ@mail.gmail.com> <4E44394E.1050605@admadic.de>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

I solved part of my problem. It looks like python is not found during
jail startup - I'd assume PATH is incorrectly set. When I change my
moin.fcgi script's shebang line, it works:

moin.fcgi:

#!/usr/local/bin/python
# old:
# !/usr/bin/env python
...

Since it works now, I conclude that env can't find python in the PATH.
Tomorrow I will go searching where this gets defined and until then this
little fix will have to do :-) (time to clean up my changes in the
lighttpd sources and do a fresh build...)

best regards,
Rainer

On 8/11/2011 10:19 PM, Rainer Schwarze wrote:
> On 8/11/2011 7:35 PM, Olivier Duchateau wrote:
>> Hi,
>>
>> MoinMoin wiki is written in Python, so lighttpd must be configured
>> either wscgi (fastcgi) or cgi.
> 
> Hi,
> 
> fastcgi is activated and does work.
> 
> I spent some more time on that and looked into the sources and inserted
> some debug output statements (error.log and code snippet below). I'd say
> that during manual start 6 child processes are started, during jail
> startup only 1 is started. The line "xxx child 4" is written just before
> the call to execve which starts the cgi. The line "xxx child 5" does not
> appear - it would, if execve would return - so that seems ok.
> 
> The lines "child 6" and "child 7" are written before the call to
> waitpid. They appear only once, so I guess, the first child fails. (in
> contrast to a second child causing errors)
> 
> My next steps will be to look into the moin.fcgi script and try to add
> some debugging statements. I'd assume that this goes belly up at some
> point. However, maybe in a few hours - for now I have to get back to the
> work which pays my bills :-)
> 
> Does this provide some hints where my problem could be?
> 
> Thanks and best regards,
> Rainer
> 
> 
> The error.log:
> 
> ( -------- when jail starts: ------------)
> 2011-08-11 19:55:35: (log.c.166) server started
> 2011-08-11 19:55:35: (mod_fastcgi.c.1098) xxx child 6
> 2011-08-11 19:55:35: (mod_fastcgi.c.1007) xxx child 1
> 2011-08-11 19:55:35: (mod_fastcgi.c.1015) xxx child 2
> 2011-08-11 19:55:35: (mod_fastcgi.c.1076) xxx child 3
> 2011-08-11 19:55:35: (mod_fastcgi.c.1079) xxx child 4
> 2011-08-11 19:55:35: (mod_fastcgi.c.1101) xxx child 7
> 2011-08-11 19:55:35: (mod_fastcgi.c.1114) the fastcgi-backend
> /usr/local/www/wiki/admadic/moin.fcgi failed to start:
> 2011-08-11 19:55:35: (mod_fastcgi.c.1118) child exited with status 127
> /usr/local/www/wiki/admadic/moin.fcgi
> 2011-08-11 19:55:35: (mod_fastcgi.c.1121) If you're trying to run your
> app as a FastCGI backend, make sure you're using the FastCGI-enabled
> version.
> If this is PHP on Gentoo, add 'fastcgi' to the USE flags.
> 2011-08-11 19:55:35: (mod_fastcgi.c.1409) [ERROR]: spawning fcgi failed.
> 
> 
> The source snippet from mod_fastcgi.c:
> 
> ...
> /* father */
> /* wait */
> log_error_write(srv, __FILE__, __LINE__, "s", "xxx child 6");
> select(0, NULL, NULL, NULL, &tv);
> log_error_write(srv, __FILE__, __LINE__, "s", "xxx child 7");
> switch (waitpid(child, &status, WNOHANG)) {
> case 0:
>   /* child still running after timeout, good */
>   log_error_write(srv, __FILE__, __LINE__, "s", "xxx child 8");
>   break;
> case -1:
>   /* no PID found ? should never happen */
>   log_error_write(srv, __FILE__, __LINE__, "ss", "pid not found:",
> strerror(errno));
>   return -1;
> default:
>   log_error_write(srv, __FILE__, __LINE__, "sbs",
>     "the fastcgi-backend", host->bin_path, "failed to start:");
>   /* the child should not terminate at all */
>   if (WIFEXITED(status)) {
>     log_error_write(srv, __FILE__, __LINE__, "sdb",
>       "child exited with status",
>       WEXITSTATUS(status), host->bin_path);
>     log_error_write(srv, __FILE__, __LINE__, "s",
>       "If you're trying to run your app as a FastCGI backend, make sure
> you're using the FastCGI-
> enabled version.\n"
>       "If this is PHP on Gentoo, add 'fastcgi' to the USE flags.");
> ...
> 
> 
> 
> 
> thanks and best regards,
> Rainer
> 
>>
>> 2011/8/11 Rainer Schwarze <rsc@admadic.de>:
>>> On 8/11/2011 3:31 AM, Sahil Tandon wrote:
>>>> On Wed, 2011-08-10 at 23:27:25 +0200, Rainer Schwarze wrote:
>>>>
>>>>> I want to run a moinmoin wiki in a jail via lighttpd. When I start the
>>>>> jail, lighttpd logs an error and stops. When I run it manually, it
>>>>> starts without problems and I can access the wiki in the browser.
>>>>>
>>>>> It looks like there are certain differences between starting when the
>>>>> jail starts and starting manually. Which of those would influence this
>>>>> issue? Can you give me any hints where I should start looking? (I asked
>>>>> google but didn't get useful results.)
>>>>
>>>> What is the output of the following command, inside the jail, as the
>>>> user that runs lighttpd?
>>>>
>>>>  % php-cgi -v
>>>
>>> srvks# php-cgi -v
>>> php-cgi: Command not found.
>>>
>>> :-) php is not needed there (at least I hope so).
>>>
>>>>
>>>>> 2011-08-10 20:54:54: (mod_fastcgi.c.1108) child exited with status 127
>>>>> /usr/local/www/wiki/admadic/moin.fcgi
>>>>
>>>> Without more information, my WAG is that certain files (libraries,
>>>> perhaps) used by fcgi cannot be found by lighttpd from inside the jail.
>>>
>>> The confusing part is, I can start it in the jail manually with
>>>
>>> /usr/local/etc/rc.d/lighttpd start
>>>
>>> So all the required things should be there.
>>>
>>> Are there any debug flags which I could activate to get more output from
>>> lighttpd? I probably don't need those which log requests etc. There
>>> don't seem to be any as command line parameter?
>>>
>>> best regards,
>>> Rainer
>>> --
>>> Rainer SCHWARZE (Mr.)
>>> _______________________________________________
>>> freebsd-ports@freebsd.org mailing list
>>> http://lists.freebsd.org/mailman/listinfo/freebsd-ports
>>> To unsubscribe, send any mail to "freebsd-ports-unsubscribe@freebsd.org"
>>>
>>
>>
>>
> 

-- 
Rainer SCHWARZE (Mr.)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4E45849A.8090300>