How to pass the PATH variable to Bamboo when running it as a systemd service in RedHat Enterprise Linux 7
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Problem
When running Bamboo as a systemd service in RedHat Enterprise Linux (RHEL) 7 the PATH variable will not be automatically inherited by the Bamboo process.
This happens due to an OS restriction since systemd will not pass the PATH variable available for that user to any process started from it unless you explicitly pass the variable.
Resolution
Add and environment directive to your service passing the PATH values you want:
1. Edit the systemd configuration file for Bamboo
vi /usr/lib/systemd/system/bamboo.service
2. Add the following environment directive:
Environment=PATH=/opt/location_of_your_executable
3. Reload Daemon
systemctl daemon-reload
4. Restart Bamboo
systemctl stop bamboo; systemctl start bamboo