Hi William,
We've done some reverse engineering of monitor<->woadaptor
communications and have written a Capistrano task (have you worked
with it? it's a great tool for automating deployment procedures - our
deployment system is based on Capistrano) that restarts given
application. It is attached to the letter. If you're not using
capistrano you should still be able to adapt the code without much
problems.

Actually, what it does is:
1. It reads the /Library/WebObjects/Configuration/SiteConfig.xml file
and determines instances port numbers
2. It forms termination request of the following form:
      POST /cgi-bin/WebObjects/#{project_name}.woa/womp/instanceRequest HTTP/1.0
      cookie:
      content-length: #{terminate_request.length}

      <instanceRequest type="NSDictionary">
        <commandInstance type="NSDictionary">
          <command type="NSString">TERMINATE</command>
        </commandInstance>
      </instanceRequest>
3. It sends the request to the ports discovered on step 1.
Applications are immediately terminated. We assume that autorecover is
turned on for them, so they get restarted immediately after
termination.

I suppose that this approach should work ok for you. The advantage of
capistrano is that all commands can be executed on any host. So you
can restart the app on any server. The limitation is that you can't
specify more than one host at a time. Here is the usage example:
cap HOSTS="127.0.0.1" -f restart_app.cap -S projects_list="MyApp" restart_app_sh
cap HOSTS="127.0.0.1" -f restart_app.cap -S
projects_list="MyApp,MyAnotherApp" restart_app_sh

-- 
With best regards,
Michael Bushkov

Attachment: restart_app.cap
Description: Binary data

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-deploy mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-deploy/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to