|
From: Ethan M. <merritt@u.washington.edu> - 2010-06-04 17:52:35
|
On Friday 04 June 2010 06:11:47 am pl...@pi... wrote:
> Hi,
>
> I'm not really sure this is a gnuplot problem , I'm having trouble
> seeing where the problem lies.
>
> I have a cgi responder written in C that works fine when running gnuplot
> directly but if I add "&" to the command sting it fails.
>
> I have both post.cgi and test.gnu in my cgi directory , it is called by
> lighttpd in response to a FORM post method.
>
> within post.c :
>
> system("gnuplot test.gnu" );
> OK.
> system("gnuplot test.gnu &" );
> Fails to produce output but the call returns zero since it apparently
> succeeds in creating the gnuplot process and backgrounding it before
> gnuplot fails.
>
> It looks like a permissions problem or file path but testing from
> command line it works and not backgrounding the process works for the cgi.
>
> First line in test.gnu fails to create the file:
> system("touch /www/apache/htdocs/gnuplot.ran");
>
> Equally , calling gnuplot with the full path of the .gnu file also fails.
>
> Why is gnuplot failing when I detach the process?
I don't know. Perhaps the lighttpd thread that spawned your gnuplot command
has already exited by the time gnuplot tries to do anything.
What happens if you take gnuplot out of the picture while debugging?
E.g. try testing
system("ls test.gnu > /www/apache/htdocs/debug.out")
vs
system("ls test.gnu > /www/apache/htdocs/debugbg.out&")
|