|
From: <pl...@pi...> - 2010-06-04 14:11:50
|
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?
TIA.
|
|
From: Thomas S. <t.s...@fz...> - 2010-06-04 17:41:55
|
without '&' the c-program waits for gnuplot to terminate and then
goes on. so it is guaranteed that gnuplot did its job when the
c-program finishes.
with '&' the c-program starts gnuplot without waiting and goes
on directly.
so it may happen that the c-program has finished while the gnuplot
process is still running in background or waits to get some cpu time.
Plotter-2 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?
>
> TIA.
>
> ------------------------------------------------------------------------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit. See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
> _______________________________________________
> gnuplot-beta mailing list
> gnu...@li...
> https://lists.sourceforge.net/lists/listinfo/gnuplot-beta
>
>
--
View this message in context: http://old.nabble.com/gnuplot-fails-in-background.-tp28780509p28783036.html
Sent from the Gnuplot - Dev mailing list archive at Nabble.com.
|
|
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&")
|
|
From: Hans-Bernhard B. <HBB...@t-...> - 2010-06-04 20:27:16
|
pl...@pi... wrote: > 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. Well, so don't do that, then! Whatever did you hope to achieve by that, in the first place? > Why is gnuplot failing when I detach the process? Possibly because non-interactive shells don't support backgrounding interactive processes? |
|
From: <pl...@pi...> - 2010-06-06 15:06:23
|
On 06/04/10 22:27, Hans-Bernhard Bröker wrote: > pl...@pi... wrote: > >> I have a cgi responder written in C that works fine when running >> gnuplot directly but if I add "&" to the command string it fails. > > Well, so don't do that, then! > Well that one approach, I'd rather debug the problem. > Whatever did you hope to achieve by that, in the first place? > I was "hoping" for exactly what I have had working for the last two years. Calling gnuplot NON-INTERACTIVELY to plot some real-time data. >> Why is gnuplot failing when I detach the process? > > Possibly because non-interactive shells don't support backgrounding > interactive processes? > Your attempts at being a sarcastic smart-arse would look less stupid if you did not make sweeping assumptions. No where did I suggest I was running gnuplot interactively. Ethan's suggestion has enabled me to establish that this problem is more general than the call to gnuplot. So I won't discuss this further on this list. Now fixed. Thanks Ethan. |