Make Atlassian Bamboo start as a Systemd service on Linux (CentOS).
Add a new bamboo
user and group as explained in the Atlassian's tutorial.
useradd --create-home -c "Bamboo role account" bamboo
Make sure the binary and home directories are owned by the new user:
chown bamboo:bamboo /opt/atlassian/bamboo
chown bamboo:bamboo /var/atlassian/application-data/bamboo
Add the following to /etc/systemd/system/bamboo.service
:
[Unit]
Description=Atlassian Bamboo Service
After=syslog.target network.target postgresql.service
[Service]
User=bamboo
Group=bamboo
Type=forking
Environment=BAMBOO_HOME=/var/atlassian/application-data/bamboo
ExecStart=/opt/atlassian/bamboo/bin/start-bamboo.sh
ExecStop=/opt/atlassian/bamboo/bin/stop-bamboo.sh
[Install]
WantedBy=multi-user.target
Reload the services via:
systemctl daemon-reload
To start/stop the service run:
systemctl start bamboo
systemctl stop bamboo
To enable the service to start after reboot:
systemctl enable bamboo