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

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

Judy Romano
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 13, 2018

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 Kyalangalilwa
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.
August 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.

Rodri Alvarez April 18, 2019

Same issue here.

Manoj Dhungana
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 18, 2019

Same here ! No updates yet ?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events