Re: Stopping/Restarting instance from the command line

Anazys-WO <[email protected]> Tue, 24 Aug 2004 17:53:45 +0200
Newsgroups gmane.comp.web.webobjects.admin
Message-ID <[email protected]>
Hi Pierre, sorry for the delay

> Runtime.exec() can be a bit tricky to get to work in a conistent  
> manner on different platforms. But one you got it up and running it  
> probably is the cleanest way to start a WebObjects application.  
> Question is if this is really what you want to do. At some point you  
> are going to need information from WOTask like port number, output  
> path ...
You are right, I'll need these information too.
>  which you may not want to hardcode/duplicate. That is unless you are  
> trying to replace WOTask/Monitor for managing applications.
It's exactly what I want to do, I'm trying to do a "new" Monitor.  
That's why I was wondering about WOApplication. It can do pretty much  
whatever I need to, but I don't know if (and How) I can call  
WOApplication from AdminApp.woa to start (stop, ect) appliclient1.woa.  
I mean how to initialize appliclient1.woa from within AdminApp.woa.
Do you know how I could do it?
>
> As for interacting with a running application you have plenty of  
> choices. As I said you could tap into the protocol used by WOTask.
Do you have any pointer to documentation on how  to do it?
>  Or, as Karl suggested, you could create your own set of direct  
> actions. If you do so you would do good to check the client IP in your  
> DA code. You might also use plain sockets or RMI. This might be easier  
> to keep behind the firewall. You could also use the file system for  
> communication. An extra thread in your application could check the  
> modification date of a config file. Upon change it would read in the  
> new instructions.
Sounds quite complicated to me;)

Don't hesitate to tell me if you think I'm going the wrong way:)

Xavier

PS: I can launch an app using the command-line, but I have no mean to  
keep in contact with the instance, like I cannot know if the instance  
is alive, tell it to stop accepting sessions, modify it's scheduled  
etc...(I need to do it without Monitor).

>
> Pierre.
>
> -----Original Message-----
> From: Hsu [mailto:[email protected]]
> Sent: Thursday, August 19, 2004 7:04 PM
> To: Dev WO
> Cc: Pierre Bernard; [email protected];
> [email protected]
> Subject: Re: Stopping/Restarting instance from the command line
>
>
> To start another application, just use Runtime.exec() and friends to
> run the shell script inside the woa.
>
> To stop applications, you can have a custom communication's protocol
> that calls the WOApplication methods, or you can use direct actions
> (which is what Monitor/wotaskd use). Be careful with DA's - they may be
> accessible through the webserver.
>
> Karl
>
> On Aug 19, 2004, at 9:07 AM, Dev WO wrote:
>
>> Thanks Pierre, but I don't know exactly how to do it:(
>> So I started to relax a little and re-evaluate what I wanted to do.
>> I found that with WOApplication I could start, stop and do pretty much
>> everything with my application/instance, so it looks like what I need.
>> BUT it looks like WOApplication only affect the application that make
>> the call... and I don't want to do that, I'd like to call
>> WOApplication (from application A) to start application B. Is this
>> possible? I couldn't find something like setPath to tell WOApplication
>> which .woa to start.
>>
>> Thanks for helping me clarify this;)
>>
>> Xavier
>>
>>> Well, you could reverse-engineer the communication protocol between
>>> Monitor/WOTaskd and the WO applications.
>>>
>>> Actually with the appropriate network tools you should be able to see
>>> the calls made. These are DirectAction-like calls which you might be
>>> able to issue with tools like wget or curl. At worst you would have
>>> to write a small Java app.
>>>
>>> Pierre
>>>
>>> -----Original Message-----
>>> From: [email protected]
>>> [mailto:[email protected]]On Behalf Of Dev WO
>>> Sent: Wednesday, August 18, 2004 3:44 PM
>>> To: [email protected]; [email protected]
>>> Subject: Stopping/Restarting instance from the command line
>>>
>>>
>>> Hi,
>>> I was wondering if there is a more cleaver way to stop and restart an
>>> instances from the command line than killing the PID?
>>> Thanks for your knowledge;)
>>>
>>> Xavier
>>> _______________________________________________
>>> webobjects-deploy mailing list | [email protected]
>>> Help/Unsubscribe/Archives:
>>> http://www.lists.apple.com/mailman/listinfo/webobjects-deploy
>>> Do not post admin requests to the list. They will be ignored.
>>>
>>>
>>>
>>> ********************************************************************* 
>>> *
>>> This email and any files transmitted with it are intended solely for
>>> the use of the individual or entity to whom they are addressed.
>>> If you have received this email in error please notify the sender
>>> of this message. ([email protected])
>>> This email message has been checked for the presence of computer
>>> viruses; however this protection does not ensure this message is
>>> virus free.
>>> Banque centrale du Luxembourg; Tel ++352-4774-1; http://www.bcl.lu
>>> ********************************************************************* 
>>> *
>>>
>>>
>>
>> _______________________________________________
>> WebObjects-admin mailing list
>> [email protected]
>> http://www.omnigroup.com/mailman/listinfo/webobjects-admin
>>
> --
>
> Invention: Man creates the automobile to go places without walking.
> Progress: Man creates the treadmill for walking without going places.
>
> Homepage:
>       http://homepage.mac.com/khsu/index.html
>
>
>
> **********************************************************************
> This email and any files transmitted with it are intended solely for
> the use of the individual or entity to whom they are addressed.
> If you have received this email in error please notify the sender
> of this message. ([email protected])
> This email message has been checked for the presence of computer
> viruses; however this protection does not ensure this message is
> virus free.
> Banque centrale du Luxembourg; Tel ++352-4774-1; http://www.bcl.lu
> **********************************************************************
> _______________________________________________
> webobjects-deploy mailing list | [email protected]
> Help/Unsubscribe/Archives:  
> http://www.lists.apple.com/mailman/listinfo/webobjects-deploy
> Do not post admin requests to the list. They will be ignored.
>
>