I am trying to keep a web process running after the Jenkins job is done.
I looked into ProcessTreeKiller and have tried using BuildId
as below, but it doesn't seem to work:
BUILD_ID=dontKillMe /usr/apache/bin/httpd
My command (which I want to keep it running):
rails s &
How can I fix this issue ?
You put that into your Execute Shell build step, not as a jenkins build process variable (which is what you did with EnvInject plugin in your screenshot)
So, if you are trying to run rails &
, then do:BUILD_ID=dontKillMe rails &
Try with:
(
set -e
export BUILD_ID=dontKillMe
export JENKINS_NODE_COOKIE=dontKillMe
rails &
) &
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With