Thursday, September 12, 2013

Running Atlassian Jira, Confluence, and Stash using systemd unit files

One of the things that I've always been annoyed with when trying to run the atlassian products is the lack of proper integration into the linux init systems. They provide some support for basic sysvinit, but nothing for systemd or others.

Here are some unit files that I whipped up for them. Obviously nothing fancy but hopefully it helps some wayward souls.

Jira:
[Unit]
Description=Atlassian Jira
After=network-online.target

[Service]
Type=simple
ExecStart=/opt/atlassian/jira/bin/start-jira.sh -fg
ExecStop=/opt/atlassian/jira/bin/stop-jira.sh
Restart=always
RestartSec=30

[Install]
WantedBy=multi-user.target

Confluence:
[Unit]
Description=Atlassian Confluence
After=network-online.target

[Service]
Type=simple
ExecStart=/opt/atlassian/confluence/bin/start-confluence.sh -fg
ExecStop=/opt/atlassian/confluence/bin/stop-confluence.sh
Restart=always
RestartSec=30

[Install]
WantedBy=multi-user.target
 Stash:
[Unit]
Description=Atlassian Stash
After=network-online.target

[Service]
Type=simple
ExecStart=/opt/stash/bin/start-stash.sh -fg
ExecStop=/opt/stash/bin/stop-stash.sh
Restart=always
RestartSec=30

[Install]
WantedBy=multi-user.target


P.S. Don't forget to enable the appropriate network-online.target on your system. The Atlassian products don't appreciate being started with no network available.  If you use NetworkManager, you can do this with "# systemctl enable NetworkManager-wait-online.service"

No comments:

Post a Comment