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

Run jira as a service in linux

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 Aug 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

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

It looks fully documentation not updated.

Hi Dave,

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

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

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

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
TAGS

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