What's the proper way to launch a script from jenkins, don't get the build hanging, and leave the process running? I can't seem to get it to work. Either the script doesn't run or the build hangs.
If I put in the build's "Execute shell" step bash relaunch.sh &
or relaunch.sh > output.log &
or nohup bash relaunch.sh &
,
nothing happens; build finishes, but the process doesn't run. I guess it can be related to Jenkins waiting for the error pipe to close.
If I do
nohup bash relaunch.sh 2>&1 > output.log
as suggested here, the output is properly redirected, but the build hangs (doesn't finish), and the process dies when I kill the build.
Adding export BUILD_ID=dontKillMe
, as suggested here, here, and here, either to the "Execute shell" step or the script itself doesn't help either. The build hangs and the process dies when I kill the build. Needless to say, my knowledge of linux is very limited.
How do people do this in a clean way?