Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Jira service not auto-starting when installed as a service

I installed Jira Server 7.9.2 on Ubuntu 18.04 LTS.  During installation, ran with sudo and chose Yes for 'Install JIRA as Service?'. Expected Jira to start automatically on server reboot, but it does not.

Unable to run 'sudo update-rc.d jira enable' since the /etc/init.d/jira script that was installed does not support runlevels, but is a simplistic script that supports only start and stop operations.

Found the article Starting JIRA Automatically on Linux, but expected the Jira Installation process to do this automatically, setting paths in the script and setting it up to run on reboot.

Should the Jira Installation have set this up automatically as indicated?  Is this a bug in the installer or for my particular configuration, or am I expected to follow that supplemental article after installation?

6 answers

Came across this today as well. (Jira version 8.2, Ubuntu 19) Here is a workaround I was able to come up with derived from the bamboo installation instructions.

 

After Installing jira. Make note of the start/stop script locations from /etc/init.d/jira

First stop the jira service if it is already running.

Now create file with preferred method. I used:

sudo nano /etc/systemd/system/jira.service

 

File contents:

[Unit]
Description=Atlassian Jira
After=syslog.target network.target

[Service]
Type=forking
User=jira
ExecStart=/opt/atlassian/jira/bin/start-jira.sh
ExecStop=/opt/atlassian/jira/bin/stop-jira.sh
SuccessExitStatus=143

[Install]
WantedBy=multi-user.target 

Note: ExecStart and ExecStop will be the path to your jira start/stop script. Be sure to change if different.

Next remove or move the original init.d file somewhere else for safe keeping, it shall no longer be needed.

sudo mv /etc/init.d/jira /path/to/wherever

Note: Change /path/to/wherever to a valid path

Next enable the service

sudo systemctl enable jira

Then start if you haven't already

sudo systemctl start jira 

Thanks. It works.

Like Jon_Wainman likes this

This is awesome - worked beautifully for confluence on ubuntu 18.4.3

Just did this, and it's *&^$&^ brilliant. Well done mate.

Why Atlassian can't get this figured out is beyond me.

Can someone confirm that this was all fixed in 8.3, and is no longer necessary?

Thank you Brandon. It works.

works perfectly on ubuntu 20.04

4 votes
Andy Heinzer Atlassian Team Jun 04, 2018

It appears this is a known bug.  More details in https://jira.atlassian.com/browse/JRASERVER-42000

There is also a related documentation request to update our docs, as it does not appear that Atlassian has provided a clear set of steps to use this with systemd: https://jira.atlassian.com/browse/JRASERVER-63191

I am going to go back and review other support cases on this, because I agree with you, this seems like something the Jira installation package should be able to do out of the box.

In the meantime, I found a related thread in https://community.atlassian.com/t5/Jira-questions/CentOS-7-systemd-startup-scripts-for-Jira-Fisheye/qaq-p/157575 that might be useful for configuring this.

Thanks for the quick reply.  I did find that old Bug report from Feb 2015 also.

A comment near the bottom from Alexis Huxley in 2017 helped me, which no other solution did that I attempted using systemd service scripts.

There is a simple fix that Atlassian could make to the existing shell scripts provided in the installer that create /etc/init.d/jira and /etc/init.d/confluence scripts.

File: /etc/init.d/jira

#!/bin/bash
### BEGIN INIT INFO
# Provides: jira
# Required-Start: $network $local_fs $syslog
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: JIRA Server
# Description: JIRA Server
### END INIT INFO
...

File: /etc/init.d/confluence

#!/bin/bash
### BEGIN INIT INFO
# Provides: confluence
# Required-Start: $network $local_fs $syslog
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Confluence Server
# Description: Confluence Server
### END INIT INFO
...

With these new comment lines, I was able to run the following systemd commands:

$> sudo systemctl enable jira
jira.service is not a native service, redirecting to systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable jira

$> sudo systemctl enable confluence
confluence.service is not a native service, redirecting to systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable confluence

This change allowed me to enable the jira and confluence service scripts as is, without having to create new systemd service configuration files.  Finally, those services started automatically on system start.

Prior to adding the comment lines above after #!/bin/bash, I would get the error on enable service, which prevented the bash script from loading with systemd:

$> sudo systemctl enable jira
jira.service is not a native service, redirecting to systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable jira
update-rc.d: error: jira Default-Start contains no runlevels, aborting.

$> sudo systemctl enable confluence
confluence.service is not a native service, redirecting to systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable confluence
update-rc.d: error: confluence Default-Start contains no runlevels, aborting.

If you are going to look into accelerating this bug report again, consider patching the System V init scripts with the above comments, or whatever Atlassian sees fit, so that the installation is not broken for systemd users, until full systemd service configuration scripts are provided and the installation process changed.

Like # people like this

I was surprised to see that with Jira ver 7.13 this is still a problem.

Thank you Janos Kovacs for your writeup this gave me a quick fix.

As a follow up, I learned that Ubuntu since 15.04 uses systemd instead of init or upstart.  The official Atlassian article I linked above is written for System V init scripts only, not systemd.

The Jira and Confluence installers surely should detect this and install the appropriate start-up script, so I would consider this a bug in the installation process.  Is there any official documentation on this problem or solutions for Jira?

I found a related Atlassian article for Confluence on systemd:  Run Confluence as a systemd service on linux

Also found an unofficial blog post on the subject for Jira and Confluence:  JIRA & Confluence with systemd on CentOS

So, I will attempt to adapt each of these articles to work for Jira on Ubuntu using systemd.

Still it seems like this should be supported out of the box for one of the major Linux distros and one of the top 3 system managers.

Thank you Jason Kovacs, you helped me a lot!

@ ATLASSIAN: guys..... Jira Version 8.1.0 and this bug still persists. Please add this small change to your backlog and make an admin-friendly experience possible... At the moment Jira and Confluence seems to be developed by two different companies... no fun.

8.2.2 still, unter 18.04.

It still a problem with 8.6.1 with ubuntu 18.04

 

Thanks Brandon!

Thank you Brandon. It works. on JIRA 8.6.1 and Ubuntu 19.10.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Software

How to create Jira issus from Excel file?

When to use CSV importer When managing your processes in Jira, there are many occasions where you need to create a lot of tasks. Creating them one by one will cost you a lot of time and effort and i...

4,456 views 22 32
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you