Book Image

Wildfly Cookbook

Book Image

Wildfly Cookbook

Overview of this book

Table of Contents (23 chapters)
WildFly Cookbook
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Shutting down and restarting an instance via the CLI


In this recipe, we will learn how to stop a WildFly instance via the CLI, or alternatively, restart it via the CLI.The restart option is in contrast to the reload command of the previous recipe.

Getting ready

Start up your WildFly so that we can directly connect to it via the CLI, as follows:

$ cd ~/WFC/wildfly
$ ./bin/standalone.sh

How to do it...

The command itself is pretty easy:

$ ./bin/jboss-cli.sh --connect
[standalone@localhost:9990 /] shutdown
[disconnected /]

How it works...

The preceding command stops everything and drops you off from the CLI. Hence, in case you need to restart your WildFly instance, you need to execute the standalone.sh script again, along with any parameter previously defined.

There's more...

Alternatively, if what you really need is a full stop and start, you can rely on the --restart=true option for the shutdown command.

Before executing the shutdown command with the restart option, take note of the process ID (PID...