dev@glassfish.java.net

Re: How does asadmin know

From: Tom Mueller <tom.mueller_at_oracle.com>
Date: Wed, 16 Feb 2011 12:50:44 -0600

My bad. Yes, you are right. I answered too quickly.

There is a LocalServerCommand.waitForRestartRemote method which
repeatedly calls the uptime command on the remote server to see if it is
up.

Tom

On 2/16/2011 12:19 PM, Vince Kraemer wrote:
> Are you sure? It was a remote command in 3.0 and Byron extended it in
> 3.1 to even restrart a remote server in debug mode for promoted builds
> of 3.1...
>
> Here is a snippet of the man page
>
> $ ../../GlassFish_Server/bin/asadmin restart-domain --help
>
> asadmin Utility Subcommands restart-domain(1)
>
> NAME
> restart-domain - restarts the DAS of the specified domain
>
> SYNOPSIS
> restart-domain [--help] [--debug ={true|false}]
> [--domaindir domaindir]
> [--force={true|false}] [--kill={false|true}]
> [domain-name]
>
> DESCRIPTION
> [snip]
>
> This subcommand is supported in local or remote mode. If you
> specify a host name, the subcommand assumes you are operat-
> ing in remote mode, which means you must correctly authenti-
> cate to the remote server. In local mode, you normally do
> n
>
> vbk
>
>
> Tom Mueller wrote:
>> restart-domain is a local command. So it doesn't operate on remote
>> domains. It asks the DAS to shutdown, and then uses Runtime.exec to
>> run "asadmin start-domain" again.
>>
>> Tom
>>
>> On 2/16/2011 11:46 AM, Vince Kraemer wrote:
>>> What tactic does restart-domain use to detect restart for remote
>>> domains?
>>>
>>> Thanks,
>>> vbk
>>>
>>> Tom Mueller wrote:
>>>> It's polling the server. It looks for the "pid" file to show up
>>>> and watches to see if the process exits.
>>>>
>>>> See StartServerHelper.waitForServer.
>>>>
>>>> Tom
>>>>
>>>>
>>>> On 2/15/2011 5:24 PM, vince kraemer wrote:
>>>>> that start-domain was successful?
>>>>>
>>>>> Is it polling the server or does the successful start callback to
>>>>> asadmin?
>>>>>
>>>>> Thanks,
>>>>> vbk
>>>>>
>>>
>