Reputation: 1237
I have to create a bamboo deployment plan in which I need to deploy a jar file and run it.
The jar file run infinitely( till the java process is killed )
I have used command to run the jar from deployment plan using ssh task
nohup java -jar /var/test.jar &
Since my jars runs infinitely bamboo deployment plan is waiting infinitely and another deployment gets stuck in queue,
what could be the solution to run the command asynchronously from bamboo or any other approach
Thanks
Upvotes: 0
Views: 809
Reputation: 8194
I believe the issue is that even though you've used nohup, the java process still inherits the standard input, output, and error from the parent shell, and that prevents ssh from exiting.
Try redirecting the standard input, output, and error of your process.
nohup java -jar /var/test.jar </dev/null >/dev/null 2>&1 &
Upvotes: 1