Run jira as a service in linux

Padmasree P August 27, 2018

how do we run Jira as a service in rhel 7. so even after server reboot Jira starts automatically . I have setup Jira using the archive file. please help on this

2 answers

1 accepted

7 votes
Answer accepted
Daniel Eads
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 28, 2018

Hi Padmasree,

Red Hat / CentOS 7 uses systemd which doesn't use the chkconfig command anymore. The .bin installer will configure Jira automatically, but as you installed from the archive you'll need to follow these steps:

  1. Log in to your Red Hat 7 server
  2. Run the following commands to create a service config:
    sudo touch /lib/systemd/system/jira.service
    sudo chmod 664 /lib/systemd/system/jira.service
  3. Open the file for editing (I prefer vim - use whatever text editor you're comfortable with)
    sudo vim /lib/systemd/system/jira.service
  4. Paste the config below to create the service file. Note that if you installed somewhere other than /opt/atlassian, you'll need to modify the file paths accordingly. If you used a different user than jira, you'll need to update the User line.
    [Unit] 
    Description=Atlassian Jira
    After=network.target

    [Service]
    Type=forking
    User=jira
    PIDFile=/opt/atlassian/jira/work/catalina.pid
    ExecStart=/opt/atlassian/jira/bin/start-jira.sh
    ExecStop=/opt/atlassian/jira/bin/stop-jira.sh

    [Install]
    WantedBy=multi-user.target
  5. Enable the service and start it
    sudo systemctl daemon-reload
    sudo systemctl enable jira.service
    sudo systemctl start jira.service

Jira is now running as a systemd service and will start when the server starts. If you need to stop or restart the service, just do so with the systemctl command from now on:

  • sudo systemctl stop jira.service
  • sudo systemctl start jira.service
  • sudo systemctl restart jira.service

Cheers,
Daniel

Shankar Nakka June 29, 2021

Boss. I have treied above scripts in multiple environments..Its not working.

It looks fully documentation not updated.

0 votes
Dave Bosman _Realdolmen_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 27, 2018

Hi @Padmasree P

See https://confluence.atlassian.com/jirakb/starting-jira-automatically-on-linux-828796713.html

For more information on running JIRA as a service on linux.

Regards

Dave

Padmasree P August 28, 2018

Hi Dave,

I just read the document, will sudo /sbin/chkconfig --add Jira work on rhel 7

Dave Bosman _Realdolmen_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 28, 2018

Hi,

I am not a RHEL specialist but i don't see why not. Atlassian performs all testing on Centos.

A quick google search on centos vs RHEL tells me 

CentOS is a community-developed and supported alternative to RHEL. It is similar to Red Hat EnterpriseLinux but lacks the enterprise-level support. CentOS is more or less a free replacement for RHEL with few minor configuration differences. It comes with extended support lifecycle ranging from 6 to 7 years

Regards

Dave

Padmasree P August 28, 2018

Hi Dave,

when I try sudo /sbin/chkconfig --add Jira . I get error service Jira does not support chkconfig. please help

Like # people like this
Doctor February 21, 2019

That's because the script is missing this

#chkconfig: 2345 80 05

just add it at the top of the file, then you can run chkconfig, in fact, if you ever get a message saying does not support chkconfig just add 

#chkconfig: 2345 80 05

Suggest an answer

Log in or Sign up to answer