How to Run, Install, Start, and Stop Atlassian Bamboo Remote Agents

Managing your Atlassian Bamboo Remote Agents can be a breeze once you understand the initial setup and the commands needed to control the service. Let’s dive into the process of getting your agent up and running and explore how to manage it effectively.




Initial Run and Setup Scripts


When you run your agent for the first time, it generates control scripts to handle the installation and service management. To start the agent, use the following command, making sure to replace <Bamboo Base URL> with your Bamboo server’s base URL:


java [parameters] -jar atlassian-bamboo-agent-installer-X.X-SNAPSHOT.jar <Bamboo Base URL>/agentServer/ [console]


Stopping the Agent


There might be times when you need to stop your remote agent. To do this, you can identify the process and force it to terminate using the following commands:


ps aux | grep -i bamboo | awk '{print $2}' | xargs kill -9


Installation Directory


Move to the directory where the Bamboo agent is installed. In this example, we use:


cd /home/bamboo/bamboo-agent-home/bin

bash bamboo-agent.sh install


Once installed, you can manage the Bamboo agent service using systemctl commands:


systemctl enable bamboo-agent.service

systemctl start bamboo-agent.service

systemctl stop bamboo-agent.service

systemctl status bamboo-agent.service


Additionally, the Bamboo agent script supports several options:


console - Run the agent in the foreground.

start - Start the agent.

stop - Stop the agent.

restart - Restart the agent (executing stop followed by start).

status - Check the status of the agent.

dump - Take a thread dump using kill -3.


systemd Configuration


The configuration for systemd can be found at /etc/systemd/system/bamboo-agent.service. Here’s an example of how the file should look:


[Unit]

Description=Bamboo Agent

After=syslog.target


[Service]

Type=forking

User=bamboo

Group= bamboo

ExecStart=/home/bamboo/bamboo-agent-home/bin/bamboo-agent.sh start sysd

ExecStop=/home/bamboo/bamboo-agent-home/bin/bamboo-agent.sh stop sysd

KillMode=control-group

Environment=SYSTEMD_KILLMODE_WARNING=true


[Install]

WantedBy=multi-user.target


Make sure you set the correct permissions for this file and reload systemd configurations to reflect the changes:


systemctl daemon-reload


By following the steps outlined above, you’ll ensure that your Bamboo Remote Agent is installed properly, and you’ll gain the ability to manage the service with confidence. Remember that proper service management is key to maintaining a stable build environment in continuous integration and continuous deployment pipelines.

Comments

Popular posts from this blog

Overview and practical use cases with open source tracing tool for Java Apps. Glowroot. Installation

How only 2 parameters of PostgreSQL reduced anomaly of Jira Data Center nodes

Atlassian Community, let's collaborate and provide stats to vendors about our SQL index usage