how to stop confluence (from linux command line)

Deleted user June 12, 2014

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

4 answers

3 votes
Peter Van de Voorde
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 12, 2014

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
rsperafico
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 13, 2014

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

1 vote
Jeffrey Jennings
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 14, 2016

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]#

0 votes
Deleted user June 12, 2014

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events