[jboss-as7-dev] shutdown.sh equivalent

Alexey Loubyansky alexey.loubyansky at redhat.com
Thu Apr 7 15:54:55 EDT 2011


On 04/06/2011 11:00 PM, Brian Stansberry wrote:
> The management API exposes a command "shutdown" on the root resource for
> a standalone server.
>
> Here's a hack that worked for me for executing that from the CLI:
>
> pingguo:bin bstansberry$ (echo :shutdown; echo quit) | ./jboss-admin.sh
> --connect controller=localhost:9999
> =========================================================================
>
>     JBoss Admin Command-line Interface
>
>     JBOSS_HOME: .....
>
>     JAVA: .....
>
>     JAVA_OPTS:
>
> =========================================================================
>
> Connected to localhost:9999
> [localhost:9999 /] :shutdown
> Communication error: java.util.concurrent.ExecutionException:
> java.io.EOFException: Connection closed
> [localhost:9999 /] quit
> Closed connection to localhost:9999
> pingguo:bin bstansberry$
>
>
> The "--connect" argument passed to jboss-admin.sh tells it to connect
> when it starts, without a separate command after it starts. The
> "controller=localhost:9999" bit tells it how to connect. In this case
> it's unnecessary; since localhost:9999 is the default.
>
> Once I merge JBAS-9839 there will be a --file=xxx.txt option whereby
> multiple commands can be read from a file.
>
> The hack I did with (echo :shutdown; echo quit) was to get the CLI to
> read two commands from stdin: the server shutdown command and an
> instruction that the CLI itself should exit. I'm sure there are better
> ways to do that.
>
> Alexey, WDYT about something like this:
>
> ./jboss-admin.sh --connect --exec=:shutdown
>
> Basically --exec means "execute one command and exit".

I had the same thought and actually created a jira issue for that. At 
the moment I have

./jboss-admin.sh --connect file=file_path

where file_path points to the file with commands to execute and quit 
after the last one.

https://issues.jboss.org/browse/JBAS-9270

The actual syntax/argument names can/should be discussed. I can't say 
I'm completely comfortable with the current one.

Alexey

>
> On 4/6/11 3:29 AM, Jaikiran Pai wrote:
>> Now that the JIRA has been resolved, what's the script/command to
>> shutdown the server? I'm configuring some hudson jobs which will need
>> this shutdown command to start/stop the server.
>>
>> -Jaikiran
>> On Tuesday 22 March 2011 05:49 AM, Jason T. Greene wrote:
>>> Looks like we are missing an operation for standalone mode:
>>> https://issues.jboss.org/browse/JBAS-9104
>>>
>>> I'll get that to you ASAP.
>>>
>>> So right now the only reliable way is to send it a SIGINT or SIGTERM.
>>>
>>> On 3/21/11 6:50 PM, Scott Stark wrote:
>>>> For the current usage I need to be able to shutdown a standalone node,
>>>> so we could just add shutdown option to the standalone.sh, or have the
>>>> shutdown.sh. What is the syntax for shutting down a standalone instance
>>>> via the CLI?
>>>>
>>>> On 3/21/11 4:38 PM, Jason Greene wrote:
>>>>> The intention was that we would just use the CLI to do that. Although currently we do t have the convenience commands yet, the CLI just executes management operations. We could make a shutdown.sh that calls the CLI with the convenience command, if you think people will expect it. It would not work for domain mode though.
>>>>>
>>>>> Sent from my iPad
>>>>>
>>>>> On Mar 21, 2011, at 6:29 PM, Scott Stark<sstark at redhat.com>      wrote:
>>>>>
>>>>>> What is the as7 equivalent of the shutdown.sh command?
>>>>>>
>>>>>> _______________________________________________
>>>>>> jboss-as7-dev mailing list
>>>>>> jboss-as7-dev at lists.jboss.org
>>>>>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
>>>>
>>>> _______________________________________________
>>>> jboss-as7-dev mailing list
>>>> jboss-as7-dev at lists.jboss.org
>>>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
>>>
>>>
>>
>> _______________________________________________
>> jboss-as7-dev mailing list
>> jboss-as7-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
>
>



More information about the jboss-as7-dev mailing list