5

I have bash script which executes following

nohup ws --port 8080 &

when executing that script directly on remote server and closing connection - process still exists. But when i am using Jenkins "SSH plugin" - process stops after Jenkins closes connection. To execute that script i am using simple command sh scriptName.sh

Dave M
  • 13,250

1 Answers1

0

Best simple solution is to use "at now" instead of "nohup"

In your job jenkins (execute shell) put :

set +e #so "at now" will run even if java -jar fails
#Run java app in background
echo "java -jar $(ls | grep *.jar | head -n 1)" | at now + 1 min
Walid
  • 1