How to reliably automatically start a remote agent on Ubuntu 12.04 startup

I have a bamboo server running on Windows 7. I also have a Virtual Box instance of Ubuntu 12.04 where I would like to automatically start an agent on startup (without logging in). What is the best way of doing this?

Note that if I login as build_meister and start the agent, it works perfectly.

I tried a Startup Applications program with automatic login turned on for user build_meister. The agent is detected by the bamboo server, but dies when it tries to create a disk store (probably because it does not have access to where it wants to create it?)

Thanks,

marion

1 answer

1 accepted

try adding something like
su - build_meister -c "/bin/sh /path/to/agent/start.sh"
to
/etc/rc.local file

Thanks, Andris!

One thing missing is that I need to automatically enter the password. But your suggestion led me to this:

in /etc/rc.local

echo -e "<password>\n" | sudo -S -u build_meister "/usr/local/bin/start_agent.sh"

(note the \n after the password)

... and in /usr/local/bin/start_agent.sh

java -jar /usr/local/bin/atlassian-bamboo-agent-installer-5.5.1.jar http://<ipaddress:port>/agentServer/

This works.

Thanks for the idea,

marion

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Marketplace Apps

Tips on how to choose the best estimation method for your planning

Planning and grooming sessions all come with their own sets of rules. Team members meet to estimate stories or other work items, all according to an agreed-upon process. And with every session comes ...

77 views 0 11
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you