zzlyzq zzlyzq - 1 year ago 102
Bash Question

After jenkins job complete, the service also down

I have met a problem.

I used Jenkins to install haproxy and start the service, but after the job complete, the executor is free, and the haproxy daemon also disappear.

if I use sleep 30s after the service start, and the haproxy service will also alive at the 30s, after that, the haproxy daemon will down.

Answer Source

This behaviour is by design, as explained in ProcessTreeKiller. To avoid daemons spawned by the Jenkins build being terminated, add

export BUILD_ID=dontKillMe

to the beginning of your shell step.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download