Unable to run nohup command from jenkins as a background process

后端 未结 7 1992
醉话见心
醉话见心 2021-02-15 10:59

UPDATE: Based on below discussion I have edited my answer for more accurate description.

I am trying to run a nohup command from jenkins. The full command is

         


        
7条回答
  •  深忆病人
    2021-02-15 11:07

    what worked for me was wrapping the nohup java -jar ... command into sh file inside execute shell command, and running that same sh file right after:

    echo "starting java jar..."
    cd [some location where jar is]
    echo "nohup java -jar [jar_name].jar &" > start-jar-in-background.sh
    sh start-jar-in-background.sh
    echo "started java jar"
    

    If I had nohup java -jar ... inline with Execute shell command, then it didn't start it from some reasons. I spent quite some time on this, hope it helps to someone ';)

提交回复
热议问题