Alaska Software Inc. - WAA ReLaunch-e
Username: Password:
AuthorTopic: WAA ReLaunch-e
Osvaldo Ramirez WAA ReLaunch-e
on Wed, 18 May 2005 19:00:20 -0600
Hello e-gurus

2 whishes

1.- Can WAA run an exe file when it enter ?
     ( this exe file, can be specific inside of ini file )

2.- Can WAA, every 1 min, see if there are file named out.waa ?
      if the file exist in the current directory then shutdown itself ?


But for what it is ?

I have a program called autonomo.exe running all day.
When it run, it call another program called monitor.exe
So if autonomo.exe crash, an it out, the monitor.exe is monitoring each 
minute, if autonomo.exe it isnot alive, it run again autonomo.exe.
when autonomo.exe enter call monitor, but if it is already running, dont 
  enter again.
This is the way that I keep my program running 24/7 the 365 day.


It is possible with WAA ?

Best Regards
Osvaldo Ramirez
Phil Ide
Re: WAA ReLaunch-e
on Fri, 20 May 2005 15:49:22 +0100
Osvaldo,

> 2 whishes
> 
> 1.- Can WAA run an exe file when it enter ?
>      ( this exe file, can be specific inside of ini file )

Yes, in the _register() function, call RunShell().

> 2.- Can WAA, every 1 min, see if there are file named out.waa ?
>       if the file exist in the current directory then shutdown itself ?

Yes, in _register() launch another thread with an interval of (for example)
30 seconds, which checks for the file.  However, if the file exists, how do
you shutdown WAA?  If you use QUIT, then the application effectively
crashes, and any open connections are aborted.

If you could exit gracefully, such as when you click the close button on
the dialog (then the Ok button the question box), then any worker-threads
servicing clients are allowed to complete before closing the application.
Also, DBF files (such as the session table) are properly flushed, the log
is properly updated etc.

The attached source does exactly that - it 'clicks' the close button on the
dialog and says 'Ok' to the query.  In the meantime, it sends back a
pleasant message to the client browser.  It also checks whether the
requesting client is on the local machine, otherwise it rejects the request
to close it.

You can modify this code to it can be called by your new checking thread
like this:

Function PleaseLetMeDieGracefully( oHtml, oContext )
   local oThread := Thread():new()
   oThread:start({||tiddles()})
   return TRUE


Regards,

Phil Ide

***************************************
* Xbase++ FAQ, Libraries and Sources: *
* goto: http://www.idep.org.uk/xbase  *
***************************************

I think a good gift for the President would be a chocolate revolver. and
since
he is so busy, you'd probably have to run up to him real quick and give it
to
him.

shutwaa.prg
Osvaldo Ramirez Re: WAA ReLaunch-e
on Fri, 20 May 2005 08:55:00 -0600
Muchas Gracias Phil Ide


I will test ASAP

Best Regards
Osvaldo Ramirez
politicallyincorrect Re: WAA ReLaunch-e
on Fri, 27 May 2005 10:00:01 -0600
HUm............ I would think you can create a thread sampling the File 
location and if the file is found terminate WAA..with a QUIT


Part of WAA

Run thread x
Thread looks for file every (x) mins
if File is found, issue what ever close downs you want and quit the 
application, the Thread request to quit will also kill WAA if the thread 
is part of the EXE
Include WAA in your project file
Call WAA

now your program is running a thread for WAA and a thread for sampling 
your file directory

IF and When the Thread finds the file in question it Terminates the EXE...

WA-LA

Kurt

Osvaldo Ramirez wrote:
> 
> Hello e-gurus
> 
> 2 whishes
> 
> 1.- Can WAA run an exe file when it enter ?
>     ( this exe file, can be specific inside of ini file )
> 
> 2.- Can WAA, every 1 min, see if there are file named out.waa ?
>      if the file exist in the current directory then shutdown itself ?
> 
> 
> But for what it is ?
> 
> I have a program called autonomo.exe running all day.
> When it run, it call another program called monitor.exe
> So if autonomo.exe crash, an it out, the monitor.exe is monitoring each 
> minute, if autonomo.exe it isnot alive, it run again autonomo.exe.
> when autonomo.exe enter call monitor, but if it is already running, dont 
>  enter again.
> This is the way that I keep my program running 24/7 the 365 day.
> 
> 
> It is possible with WAA ?
> 
> Best Regards
> Osvaldo Ramirez
> 
> 
> 
> 
> 
> 
> 
> 
> 
>
Phil Ide
Re: WAA ReLaunch-e
on Fri, 27 May 2005 17:16:58 +0100
Kurt,

>> Osvaldo Ramirez wrote:
>> I have a program called autonomo.exe running all day.
>> When it run, it call another program called monitor.exe
>> So if autonomo.exe crash, an it out, the monitor.exe is monitoring each 
>> minute, if autonomo.exe it isnot alive, it run again autonomo.exe.
>> when autonomo.exe enter call monitor, but if it is already running, dont 
>>  enter again.
>> This is the way that I keep my program running 24/7 the 365 day.
>> 
>> It is possible with WAA ?
>
> HUm............ I would think you can create a thread sampling the File 
> location and if the file is found terminate WAA..with a QUIT

As a much better solution, I am developing a WAA remote controller.  By
simply adding a new pre-built package to WAA, it automatically falls under
the control of a remote control server (an application which runs as a
service on the same machine). I've managed to hook into some internal
routines in WAA, so I can detect the difference between WAA crashing and a
graceful shutdown initiated by the user, and in the event of a crash, the
remote control server can re-launch WAA.

In addition, the server application can accept connections from remote
client applications, which can be used to interrogate WAA stats,
load/unload packages, start and stop WAA etc., all without having anything
more than a network connection to the WAA machine.

Regards,

Phil Ide

***************************************
* Xbase++ FAQ, Libraries and Sources: *
* goto: http://www.idep.org.uk/xbase  *
***************************************

I went to a general store.  They wouldn't let me buy anything specifically.
	-- Steven Wright