Re: ScriptUser issue

2005-11-21 Thread Michiel Boland

Hi.

[snippage]
Mon Nov 21 21:09:26 2005 [94371] get_path_info: curdir = 
"/usr/home/www/default-site"

Mon Nov 21 21:09:26 2005 [94371] get_mime: type=/usr/local/bin/php, class=3
Mon Nov 21 21:09:26 2005 [94371] close_rfd: 5
Mon Nov 21 21:09:26 2005 [94371] child process 94372 created
Mon Nov 21 21:09:26 2005 [94371] process_cgi: 5
Mon Nov 21 21:09:26 2005 [94371] process_request finished (s=-1)
Mon Nov 21 21:09:26 2005 [94371] child process 94372 exited with status 5


First of all, my apologies for these cryptic error messages. :) (Boring, 
technical explanation follows, please skip this if you're not interested.)
The problem is that if mathopd is compiled with HAVE_VFORK, the child 
process is not allowed to do anything fancy, like log an error, until it 
has started to execute the CGI program. That is why I have used the 
child's exit code as a primitive means of communication. See the spawn() 
function in main.c for details.


Now, to help you with your problem (well, hopefully)

The 'status 5' probably means that the directory, or parent directories of 
/usr/home/www/default-site are not accessible to the scriptuser. Do a


ls -ld / /usr /usr/home /usr/home/www /usr/home/default-site

and check that (a) each of these directories exists and (b) all three 'x' 
bits are set in the permissions column for each of the directories.


HTH

Cheers
Michiel


ScriptUser issue

2005-11-21 Thread Stéphane Leclerc
I have been trying to use the combination "StayRoot On" + ScriptUser  
but it never worked for me.  I always get "child process # exited  
with status 5" for PHP or CGI sripts. (See debug below)  When  
"StayRoot Off" is used, PHP or CGI scripts work fine.


Thanks Michiel for mathopd


Mon Nov 21 21:09:19 2005 [94371] *** Mathopd/1.5p5 starting
Mon Nov 21 21:09:19 2005 [94371] NumConnections=64 nfiles=1850
Mon Nov 21 21:09:19 2005 [94371] fds: 4
Mon Nov 21 21:09:19 2005 [94371] events:  1
Mon Nov 21 21:09:26 2005 [94371] revents: 1
Mon Nov 21 21:09:26 2005 [94371] accept_connection: 3
Mon Nov 21 21:09:26 2005 [94371] fds: 43
Mon Nov 21 21:09:26 2005 [94371] events:  11
Mon Nov 21 21:09:26 2005 [94371] revents: 01
Mon Nov 21 21:09:26 2005 [94371] read_connection: 3 0 2048 369
Mon Nov 21 21:09:26 2005 [94371] process_request: /usr/home/www/ 
default-site/test.php
Mon Nov 21 21:09:26 2005 [94371] get_path_info: open("/usr/home/www/ 
default-site/test.php") = 5
Mon Nov 21 21:09:26 2005 [94371] get_path_info: curdir = "/usr/home/ 
www/default-site"
Mon Nov 21 21:09:26 2005 [94371] get_mime: type=/usr/local/bin/php,  
class=3

Mon Nov 21 21:09:26 2005 [94371] close_rfd: 5
Mon Nov 21 21:09:26 2005 [94371] child process 94372 created
Mon Nov 21 21:09:26 2005 [94371] process_cgi: 5
Mon Nov 21 21:09:26 2005 [94371] process_request finished (s=-1)
Mon Nov 21 21:09:26 2005 [94371] child process 94372 exited with  
status 5

Mon Nov 21 21:09:26 2005 [94371] fds: 45
Mon Nov 21 21:09:26 2005 [94371] events:  11
Mon Nov 21 21:09:26 2005 [94371] revents: 01
Mon Nov 21 21:09:26 2005 [94371] readfromchild: 5 0 4096 0
Mon Nov 21 21:09:26 2005 [94371] readfromchild: premature end of  
script headers (ipp=0)

Mon Nov 21 21:09:26 2005 [94371] cgi_error
Mon Nov 21 21:09:26 2005 [94371] close_rfd: 5
Mon Nov 21 21:09:26 2005 [94371] fds: 43
Mon Nov 21 21:09:26 2005 [94371] events:  14
Mon Nov 21 21:09:26 2005 [94371] revents: 04
Mon Nov 21 21:09:26 2005 [94371] write_connection: 3 0 246 246
Mon Nov 21 21:09:26 2005 [94371] fds: 43
Mon Nov 21 21:09:26 2005 [94371] events:  11