1. Using system() at Web Host
- Posted by cklester <cklester at yahoo.com> Oct 11, 2005
- 467 views
I'm using system() to run a program (mailer.exu) when a link on my web page is clicked. The thing is, the program I run will be doing something like this:
while TRUE do -- do some stuff sleep(300) -- sleep on it if time_to_exit() then exit end if end while
So it should stay active once the web server is done with the system() call, but it seems to hang, waiting for system() to return with something. I know that should not be the case with system(). Any hints on how to track this down? It seems the mailer.exu program and the web server are intricately linked when they should not be. -=ck "Programming in a state of EUPHORIA." http://www.cklester.com/euphoria/
2. Re: Using system() at Web Host
- Posted by Andy Serpa <ac at onehorseshy.com> Oct 12, 2005
- 467 views
cklester wrote: > > I'm using system() to run a program (mailer.exu) when a link on my web page is > clicked. The thing is, the program I run will be doing something like this: > > }}} <eucode> > while TRUE do > -- do some stuff > sleep(300) -- sleep on it > if time_to_exit() then > exit > end if > end while > </eucode> {{{ > > So it should stay active once the web server is done with the system() call, > but it seems to hang, waiting for system() to return with something. I know > that should not be the case with system(). > > Any hints on how to track this down? It seems the mailer.exu program and the > web server are intricately linked when they should not be. > > -=ck > "Programming in a state of EUPHORIA." > <a > href="http://www.cklester.com/euphoria/">http://www.cklester.com/euphoria/</a> > Both system() and system_exec() hang waiting for the call to return (i.e. your program to exit). At least on Windows they do, and it sounds like your Linux server acts the same way. I don't know the API to get around it on Linux, but I'm sure someone does?
3. Re: Using system() at Web Host
- Posted by Patrick Barnes <mrtrick at gmail.com> Oct 12, 2005
- 483 views
- Last edited Oct 13, 2005
For a linux app, try appending '&' to the end of the system call... ie: system("exu mailer.exu arg1 arg2 arg3 &") On 10/12/05, cklester <guest at rapideuphoria.com> wrote: > > > posted by: cklester <cklester at yahoo.com> > > I'm using system() to run a program (mailer.exu) when a link on my web pa= ge is > clicked. The thing is, the program I run will be doing something like thi= s: > > }}} <eucode> > while TRUE do > -- do some stuff > sleep(300) -- sleep on it > if time_to_exit() then > exit > end if > end while > </eucode> {{{ > > So it should stay active once the web server is done with the system() ca= ll, > but it seems to hang, waiting for system() to return with something. I k= now > that should not be the case with system(). > > Any hints on how to track this down? It seems the mailer.exu program and = the > web server are intricately linked when they should not be. > > -=ck > "Programming in a state of EUPHORIA." > http://www.cklester.com/euphoria/ > > > > -- MrTrick ----------
4. Re: Using system() at Web Host
- Posted by cklester <cklester at yahoo.com> Oct 13, 2005
- 474 views
Patrick Barnes wrote: > > For a linux app, try appending '&' to the end of the system call... > > ie: system("exu mailer.exu arg1 arg2 arg3 &") I do that. The actual call is system("./mailer.exu &",2) The program runs, but apparently doesn't run as a separate process. By that I mean that it is independent and autonomous from any other process. But I thought I could get Euphoria/Linux to do that. Am I wrong? -=ck "Programming in a state of EUPHORIA." http://www.cklester.com/euphoria/
5. Re: Using system() at Web Host
- Posted by ags <eu at 531pi.co.nz> Oct 13, 2005
- 470 views
cklester wrote: > > I do that. The actual call is > > system("./mailer.exu &",2) > > The program runs, but apparently doesn't run as a separate process. By that > I > mean that it is independent and autonomous from any other process. But I > thought I could get Euphoria/Linux to do that. Am I wrong? Just a hunch... see what happens when you do: system("/path/to/exu /path/to/mailer.exu &", 2) I can't see it making any difference but could be worth a try. ags