Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to I install bamboo agent as a daemon under Linux?

Sorin Sbarnea (Citrix)
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.
July 2, 2013
While I was able to find documentation on how to install the agent as a service for Windows, I wasn't able to find information on how to do the same for Linux. I want to be sure that if the worked/agent computer is restarted, it will restart the agent.

7 answers

1 accepted

1 vote
Answer accepted
ArmenA
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.
July 3, 2013

Hi Sorin,

If the only requirement is to start the agent when the remote agent machine gets restarted, you can configure the start remote agent command in the rc.local file the same way as it's discussed here.

Also, use the remote agent installer jar file that comes with the supervisor (wrapper). It's the big Download button on Administration -> Agents -> Install remote agent page. The wrapper will start the remote agent service if for some reason the remote agent process gets terminated.

Armen

Sorin Sbarnea (Citrix)
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.
July 8, 2013

Ok, that's a workaround but I don't like having to work to implement things that are supposed to be part of the core product. Installing and agent as a service should be the default behaviour. Also, I am impressed that Bamboo cannot start agents via SSH, like Jenkins. Yes, the user interface of Bamboo is much nicer than Jenkins, but it seems that Bamboo is not robust enough and it may require more maintenance work than Jenkins, just because it is not able to deal with workers that could come-and-go.

Anyway, thanks for the good answer, even if it's not what I was looking for it it may be the best alternative for the moment.

4 votes
Kevin Ross September 29, 2015

For systemd on ubuntu

vi /etc/systemd/system/bamboo-agent.service

Contents (be sure to adjust paths and user/group):

[Unit]
Description=Atlassian Bamboo Agent
After=syslog.target network.target
   
[Service]
Type=forking
User=apps
Group=apps
ExecStart=/apps/bamboo-agent/bin/bamboo-agent.sh start
ExecStop=/apps/bamboo-agent/bin/bamboo-agent.sh stop
   
[Install]
WantedBy=multi-user.target

Then reload and start it (as root or using sudo)

systemctl daemon-reload
systemctl start bamboo-agent

 

 

Sergey Obozhin November 9, 2017

how import .bash_profile bamboo user?

2 votes
Mehmet Aydogdu March 11, 2020

For my Amazon Linux 2 and bamboo agent 6.10.4 below worked. It installs bamboo-agent as a service and starts it.

sudo /home/bamboo/bamboo-agent-home/bin/bamboo-agent.sh installstart

 

kriegalex November 10, 2020

this worked perfectly

Like Brad Riching likes this
Brad Riching April 19, 2021

It did for me too.  Frustrating to have gone through all the online docs only to realize that they haven't updated them to match the existing functionality of bamboo-agent.sh and that magical undocumented "installstart" argument.  I wasted about 2 hours trying to adapt their documentation for bamboo server (as officially instructed by their docs) to manually configure a systemd service, inspecting and troubleshooting systemd logs.  Kudos to you for finding it, @Mehmet Aydogdu .

Like Andy Goossens likes this
2 votes
johnnyRhino March 17, 2016

Found this on the https://github.com/alienfast/bamboozled-ruby-plugin/wiki/Remote-Agents#overview site.

For my Amazon Linux instance, all I ended up needing to do was after the standard installation and running it from the command line I then symlinked the shell script like below.

sudo ln -s /apps/bamboo-agent/bin/bamboo-agent.sh /etc/init.d/bamboo-agent

and then added the bamboo-agent to chkconfig like so

sudo chkconfig -add bamboo-agent.

 

 

 

2 votes
Eric Fossum December 28, 2015

Like @Kevin Ross's post I created an upstart task, which is what Ubuntu is now using (I guess). Tested on my own Ubuntu (14.04 LTS) server.

Create an Upstart config file like `/etc/init/bamboo-agent.conf` with the following text (changing the author and /home/bamboo/bin/bamboo-agent.sh path to suit your needs.

description "A Bamboo remote agent daemon job file for Upstart"
author "Your name"
start on runlevel [2345]
stop on shutdown

pre-start script
    echo "[`date`] Bamboo remote agent starting" >> /var/log/bamboo-agent.log
    setuid bamboo
    exec /home/bamboo/bin/bamboo-agent.sh start
end script

pre-stop script
   exec /home/bamboo/bin/bamboo-agent.sh stop
   echo "[`date`] Bamboo remote agent stopping" >> /var/log/bamboo-agent.log
end script
Martin Goldhahn April 4, 2016

Your script almost worked on Trusty. The setgid and setuid have to be set outside the scripts, once the scripts are running as the user you cannot redirect the output to /var/log (unless you give the user access to /var/log/bamboo-agent.log. Why not use upstart's logging facility?

 

description "A Bamboo remote agent daemon job file for Upstart"
author "Your name"
start on runlevel [2345]
stop on shutdown
setuid bamboo
setgid bamboo

pre-start script
  logger "[`date`] Bamboo remote agent starting"
  exec /opt/bamboo-agent-home/bin/bamboo-agent.sh start
end script

pre-stop script
  exec /opt/bamboo-agent-home/bin/bamboo-agent.sh stop
  logger "[`date`] Bamboo remote agent stopping"
end script



vlada May 5, 2015

that is bamboo server, not agent

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events