ts-7000
[Top] [All Lists]

[ts-7000] Re: adc_logger from apache

To:
Subject: [ts-7000] Re: adc_logger from apache
From: "j.chitte" <>
Date: Mon, 18 Feb 2008 12:46:34 -0000
--- In  Jim Jackson <> wrote:

> Ah I knew you'd ask that, and my grey cells are failing.
> One of seteuid(), setresuid(), or setuid(), after of course having 
done
> a suitable get*uid to get your real uid.
> 
> from one of my programs dated 1996
> 
> /* get this process's uid, gid and euid..... */
> 
>     uid=getuid(); euid=geteuid(); gid=getgid();
> 
>     if (seteuid(euid)) exit(errno);
> 
> /* do stuff needing root */
> 
>     if (seteuid(uid)) exit(errno); /* turn off the setuid */
> 
> etc
> 
> > Once I have requested the IO memory , do I still need to have root
> > access to read adc channels as in your orignal adc_logger ?
> >
> > That's the only process that will remain running more than one
> > second. The other IO is pretty short lived and terminates straight
> > away.
>

Thanks once again for your help.

I have all this doing pretty much what I need but one key issue is 
holding me back.

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.

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