The process 'daemon' and 'sleep 200' should exit after 200 seconds the 'sleep' exits. The jenkins job will be finished in 60 secs.
jenkins 9954 9950 0 21:48 ? 00:00:00 sleep 60
jenkins 9955 1 0 21:48 ? 00:00:00 daemon —name=test-daemon — sleep 200
jenkins 9956 9955 0 21:48 ? 00:00:00 sleep 200
Above is the process info queried via ps command. The father pid of daemon is 1, not the script generated by jenkins.
But both the process 'daemon' and 'sleep 200' immediately exited when the script finished.
It's something really strange. Does Jenkins automatically kill all child processes forked by the script in build step? Did anybody suffer this before? How did you resolve it?
p.s: Everything works fine if I ran above script in a linux shell.
Kane Zhu