how to stop confluence (from linux command line)

how I can stop (and restart) the confluence (tomcat?) from command line on Linux?

4 answers

Hi Calogero

Simply go to you confluence installation directory, find the bin directory and there you'll find several .sh scripts. Simply execute ./stop-confluence.sh or ./shutdown.sh

you can use ps -af | grep confluence to see if the process has actually been gracefully shut down.

If this didn't happen after a few minutes you can kill the process by noting down the process id you can find using the above ps command and execute kill <processid>, be aware that this will not gracefully shut down your instance.

Best regards,

Peter

2 votes

Hi Calogero,

The following is the script mentioned by Peter Kramp on previous message:

#!/bin/bash
# Confluence Linux service controller script
cd "/opt/atlassian/confluence/bin"
case "$1" in
    start)
        ./start-confluence.sh
        ;;
    stop)
        ./stop-confluence.sh
        ;;
    restart)
        ./stop-confluence.sh
        sleep 5
        ./start-confluence.sh
        ;;
    status)
        PID=`ps aux | grep java | grep confluence | awk '{print $2}'`
        if test -z $PID
        then
        echo "Confluence is down..."
        else
        echo "Confluence is running... PID $PID"
        fi
        ;;
    *)
        echo "Usage: $0 {start|stop|restart|status}"
        exit 1
        ;;
esac

I would kindly ask you to create a file called "start-confluence.sh" and paste the above into it. Please, replace the following:

  1. Under line 3, replace "/opt/atlassian/confluence/bin" with the full path to your <confluence-install>/bin directory

Please, make sure the "start-confluence.sh" file has executable rights. In order to acchieve that, please run the following command from the directory where the file is located:

chmod a+x start-confluence.sh

In order to run the file, please use the following commands under the directory where the same is located:

# start confluence
./start-confluence.sh start

# stop confluence
./start-confluence.sh stop

# restart confluence
./start-confluence.sh restart

# confluence's status
./start-confluence.sh status

After running the command to stop, I would kindly ask you to run the command status to make sure Confluence is down. Please, notice that it might take a while to bring Confluence down, so be patience.

If even after a minute or so your Confluence instance continues on running, you can run the following command from your terminal:

# replace PID with "Confluence is running... PID $PID" given
# e.g.: "Confluence is running... PID 1234"
kill -9 1234

As Peter Van de Voorde has mentioned, this would be your last resource to stop Confluence.

Kind regards,
Rafael

Manually:

Don't use the shutdown.sh script. It is old.

Please use the stop-confluence.sh script. - it is newer (and i.m.o. much better)

Automaticly:

https://confluence.atlassian.com/display/DOC/Start+Confluence+Automatically+on+Linux

At the page's bottom you will find a VERY simple init script from Félix Martineau

when I try to stop confluence I get this:

./stop-confluence.sh stop
executing using dedicated user
If you encounter issues starting up Confluence, please see the Installation guide at http://confluence.atlassian.com/display/DOC/Confluence+Installation+Guide

Server startup logs are located in /project/confluence/logs/catalina.out
Using CATALINA_BASE: /project/confluence
Using CATALINA_HOME: /project/confluence
Using CATALINA_TMPDIR: /project/confluence/temp
Using JRE_HOME: /project/confluence/jre/
Using CLASSPATH: /project/confluence/bin/bootstrap.jar:/project/confluence/bin/tomcat-juli.jar
Using CATALINA_PID: /project/confluence/work/catalina.pid
PID file found but no matching process was found. Stop aborted.
[root@ip-10-162-1-10 bin]#

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 29, 2018 in New to Confluence

How to use Confluence Cloud for stakeholder management

Most of us don’t need much convincing that stakeholder management is important. It just makes sense that keeping everyone in-the-know on projects and assigning clearly defined roles is key to having ...

1,034 views 0 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you