You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by David kerber <dc...@verizon.net> on 2007/10/23 14:50:33 UTC

Rebooting server under program control

What would I need to do to give me the ability to reboot a windows 2003 
server machine under the control of my TC 5.5 app (JRE 1.5)?  Is there a 
java system call I can use, or do I need to call an external 
routine/script to accomplish this?

Thanks!
D



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Rebooting server under program control

Posted by David kerber <dc...@verizon.net>.
Christopher Schultz wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> David,
>
> David kerber wrote:
>   
>>> On Win XP there's shutdown.exe which you could call via Runtime#exec. My
>>> bet would be that shutdown.exe comes with Win 2003 too.
>>>   
>>>       
>> Thanks for the suggestion!
>>     
>
> Don't forget that a machine can always stay up when it's been requested
>   
Yes, I've been bitten by that before.

> to go down. You might want to have some external program that
> orchestrates this process: it tells your app to attempt to reboot the
> server, then it watches. If the server goes down and comes back up on a
> reasonable schedule (you decide), it's a success. Otherwise, flip the
> power on your power device (you /do/ have a controllable power device,
>   
That's why we buy the more-expensive UPS's...

> don't you?!), wait a few seconds and flip the power back on.
>
> You should always have a cold-restart capability in the event that the
> hot-restart fails. Otherwise, you end up with machines that are stuck in
> shutdown mode, but are never shutting down.
>
> - -chris
>   



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Rebooting server under program control

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

David,

David kerber wrote:
>> On Win XP there's shutdown.exe which you could call via Runtime#exec. My
>> bet would be that shutdown.exe comes with Win 2003 too.
>>   
> Thanks for the suggestion!

Don't forget that a machine can always stay up when it's been requested
to go down. You might want to have some external program that
orchestrates this process: it tells your app to attempt to reboot the
server, then it watches. If the server goes down and comes back up on a
reasonable schedule (you decide), it's a success. Otherwise, flip the
power on your power device (you /do/ have a controllable power device,
don't you?!), wait a few seconds and flip the power back on.

You should always have a cold-restart capability in the event that the
hot-restart fails. Otherwise, you end up with machines that are stuck in
shutdown mode, but are never shutting down.

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHHibR9CaO5/Lv0PARAl9rAKCgh/0nCM6rBCLNsuTbuLpC29yaLACfeK9A
fsDfJhSwpE/pT9JoVm7xHWs=
=UyTK
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Rebooting server under program control

Posted by David kerber <dc...@verizon.net>.
Markus Schönhaber wrote:
> David kerber wrote:
>
>   
>> What would I need to do to give me the ability to reboot a windows 2003 
>> server machine under the control of my TC 5.5 app (JRE 1.5)?  Is there a 
>> java system call I can use, or do I need to call an external 
>> routine/script to accomplish this?
>>     
>
> I would be surprised if there was a standard Java function that shuts
> down a machine.
>   
That was my suspicion when googling turned up absolutely nothing.

> On Win XP there's shutdown.exe which you could call via Runtime#exec. My
> bet would be that shutdown.exe comes with Win 2003 too.
>   
Thanks for the suggestion!
> Regards
>   mks
>   
D




---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Rebooting server under program control

Posted by Markus Schönhaber <ma...@schoenhaber.de>.
David kerber wrote:

> What would I need to do to give me the ability to reboot a windows 2003 
> server machine under the control of my TC 5.5 app (JRE 1.5)?  Is there a 
> java system call I can use, or do I need to call an external 
> routine/script to accomplish this?

I would be surprised if there was a standard Java function that shuts
down a machine.
On Win XP there's shutdown.exe which you could call via Runtime#exec. My
bet would be that shutdown.exe comes with Win 2003 too.

Regards
  mks

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org