cleanest way to restart jboss using a script

38,782

Solution 1

You have to use CLI console. To restart, type

bin/jboss-cli.sh --connect --command=:reload

To shutdown, type

bin/jboss-cli.sh --connect --command=:shutdown

Source

Solution 2

@Petr Mensik's solution works well if you need to shutdown the server. But if you need to restart it in a single operation you can use:

jboss-cli.sh -c ":shutdown(restart=true)"

Thanks to these excellent JBoss notes.

Share:
38,782

Related videos on Youtube

Saqib Ali
Author by

Saqib Ali

UI/UX Designer for an open source Ideas Bank

Updated on July 09, 2022

Comments

  • Saqib Ali
    Saqib Ali almost 2 years

    I am using " ./standalone.sh -c standalone-full.xml " to start JBOSS. What is the cleanest way to restart jboss in this case? Any scripts that you can share?

  • James R. Perkins
    James R. Perkins over 11 years
    You can also use bin/jboss-cli.sh --connect --command=":reload" if you just want to restart the server.
  • Saqib Ali
    Saqib Ali over 11 years
    @JamesR.Perkins does the "reload" wait for the pending transactions to finish before reloading?
  • James R. Perkins
    James R. Perkins over 11 years
    My guess would be yes, but to be honest I'm not sure.
  • Saqib Ali
    Saqib Ali over 11 years
    @JamesR.Perkins I tried ":reload" but I get: Communication error: java.util.concurrent.ExecutionException: Operation failed
  • James R. Perkins
    James R. Perkins over 11 years
    I've seen that from time to time and I think it's a known issue that looks like it's fixed upstream. issues.jboss.org/browse/AS7-1833