ts-7000
[Top] [All Lists]

Re: [ts-7000] Re: adc_logger from apache

To:
Subject: Re: [ts-7000] Re: adc_logger from apache
From: Jim Jackson <>
Date: Mon, 18 Feb 2008 13:49:30 +0000 (GMT)
On Mon, 18 Feb 2008, j.chitte wrote:
> --- In  Jim Jackson <> wrote:
> I need to run adc_logger (NG) for continuous sampling as a backgroud
> task and return directly to the browser interface.
>
> if I run a command like this from apache/cgi-bin it works as expected
> ./adc_logger -o ../htdocs/data/adc.data -c 0 -p 500 -f 3 -r 3 -m 1 -
> T 1,3 2,3 3,3 4,3 &
>
> but if I call it from my CGI I get all the response page back but the
> browser keeps the eggtimer going until I kill the logger process.
>
>      if (( resp=system(strcat(cmd," &")) )) {  // run in background
>        printf("<H3>setting ADC controller failed</h3>\n");
>        exit(err_rpt(resp,cmd));
>      } else
>        printf("<H3>ADC command OK</h3>\n");
>
>  printf("</BODY></HTML>\n\n");
>   fflush(stdout);
>  exit (0);
> }  /* end main */
>
>
> I have an identical problem calling gnuplot in a simliar fashion. All
> calls not run with & work as expected.
>

The programs you start in the background, are still children of apache,
and it is probably being too parental :-)

Really they need to "daemon"ise themselves, so that apache can forget 
about them. You may want to further mod adc_logger to call the daemon 
function if called with a certain flag.

> I don't see why the browser does not see the responce as completed,
> if I press the stop button and view the source all is there. It just
> seems to be awaiting something. This is odd because the call to
> system() is complete, I get the result of the following printf() and
> adc_logger should be exited already.
>
> Can anyone see what is holding the browser back?
>
> TIA.
>
>
>


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU