It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Bamboo SSH Task - calling remote script that has switch user (su) fails silently Edited

I have defined a SSH Task where the commands in the SSH Task input field are:
source /home/myuser/.bash_profile
cd /opt/app/myproject/build/TEST
./deploy_something.sh

Inside the deploy_something.sh bash script, it needs to switch user to be able to start/stop a service (i.e. logstash) that is owned by a different user (i.e. elasticsearch):
su - elasticsearch -s /bin/bash -c "$LOGSTASH_DIR/bin/logstash -f $LOGSTASH_PIPELINES &" > /dev/null 2>&1

This works great when running from within the remote server, but when called from Bamboo SSH task, it dies silently.

I've disabled the "requiretty" and "!visiblepw" configuration via visudo as discussed in https://community.atlassian.com/t5/Answers-Developer-Questions/Execute-sudo-on-remote-agent/qaq-p/523834, thinking it may be similar to a sudo issue. Does not solve the problem.

 

The Environment details are below:
Bamboo Server: centos-release-6-9.el6.12.3.x86_64
Remote Server: centos-release-6-8.el6.centos.12.3.x86_64

Anyone know a workaround or solution for this?

Thanks

1 answer

0 votes
edwin Community Leader Aug 30, 2018

Hi @Judy Romano,

Try running the command without 

>/dev/null 2>&1

so you atleast see the output and issues that maybe happening in the remote server.

Same issue here.

Same here ! No updates yet ?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bamboo

Unable to add or edit Bitbucket Cloud repository in Bamboo

On 31 May, a GDPR-related change went live in the Bitbucket Cloud API that resulted in users not being able to create or edit Bitbucket Cloud Linked repositories in Bamboo. This API update removed t...

677 views 2 7
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you