Search code examples
ubuntuubuntu-16.04bamboo

Launch bamboo agent at startup on Linux


In my situation I have an Ubuntu Server 16.04 and I want to launch a Bamboo remote agent at the startup of the machine.

I have already tried putting on /etc/systemd/system/bamboo.service this lines of code

[Unit]
Description=Bamboo Remote Agent Launcher

[Service]
User=bamboo
Group=bamboo
ExecStart=/bin/bash /home/bamboo/bamboo-agent-home/bin/bamboo-agent.sh start

[Install]
WantedBy=multi-user.target

but it seems not work, because my Bamboo do not see my agent and the systemctl status return this info

● bamboo.service - Bamboo Remote Agent Launcher
Loaded: loaded (/etc/systemd/system/bamboo.service; enabled; vendor preset: enabled)
Active: inactive (dead) since mer 2018-05-09 16:28:07 CEST; 6s ago
Process: 2872 ExecStart=/bin/bash /home/bamboo/bamboo-agent-home/bin/bamboo-agent.sh start (code=exited, status=0/SUCCESS)

Solution

  • Change the code with:

    [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
    

    Res: https://community.atlassian.com/t5/Bamboo-questions/How-to-I-install-bamboo-agent-as-a-daemon-under-Linux/qaq-p/393880