1. Using system() at Web Host

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/

new topic     » topic index » view message » categorize

2. Re: Using system() at Web Host

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?

new topic     » goto parent     » topic index » view message » categorize

3. Re: Using system() at Web Host

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
----------

new topic     » goto parent     » topic index » view message » categorize

4. Re: Using system() at Web Host

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/

new topic     » goto parent     » topic index » view message » categorize

5. Re: Using system() at Web Host

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

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu