Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I've got a problem, which I cannot solve on my own.

I want to start a bash script on bamboo, so I cannot stop it with ^C. This bash script starts a server, which should run after stopping the script.

If I start the script with the command line, it works as it should, but in order to stop the script I either have to enter Enter or ^C to exit the script. But I cannot do this in Bamboo!

This is a short version of my script:

#!/bin/bash
./Server &

I start it with: /bin/bash ./executeServer.sh &

At the end of the script I tried to write:

exit 0 -> no consequence

kill %1 -> the script stops before starting the server

^C -> unknown command

Thank you!!

share|improve this question

1 Answer

I think it is a little bit overcomplicated. Actually you do not need to start bash as it is started when You start ./executeServer.sh. Add executable rights to ./executeServer.sh and start it as it is. And do not need to start it in the background, as it already starts Server in the background in the script.

share
Thanks for this hint! This works fine, but doesn't solve my problem. – IsaMunich 2 mins ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.