java - Usage of ssehexec task in Jenkins build doesn't stop its execution -


i have ant task in jenkins ant execution plugin, post build step, remotely run shell script in 1 of our servers. shell scripts starts java process in background. when execute shell script on server directly starts java process in ground , comes out. when run jenkins via sshexec task shell script run, never comes out , jenkins build waits.

later when added timeout attribute onto sshexec times out after given number of milliseconds, jenkins build shown failed. how make sshexec task come out cleanly shell script execution?

here ssheexec task

<sshexec host="${deploy.host}" username="${deploy.username}"  password="${deploy.password}" command=". /etc/profile; cd ${deploy.path}; sh start.sh i1" trust="true" timeout="10000" /> 

the start.sh file given:

nohup java -xms512m -xmx1024m -cp calculation.jar com.tes.startcalculation $1 &  echo $! > calculation-$1-java.pid 

it looks like, ssh executed job not daemonized. starting nohup not sufficient in many cases.

see discussion related (in different context)

the issue not closing file descriptors when push background. & fine when in shell, not enough when want disconnect , leave process running, need process disconnect shell.

.... fix to correct script.

if writes naive service script not detach terminal, want know first time that script used in deployment - scm changes enable breaking change identified.

it wrong hide problem enable incorrect code released production - , not happy if first knew when production system administrator complained.

if same problem, need daemonize script


Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -