linux daemon exits unexpected after jenkins completes the shell script

7 views
Skip to first unread message

zhu kane

unread,
Jul 20, 2015, 10:39:04 AM7/20/15
to jenkins...@googlegroups.com
I put below simple script in 'Execute shell' block,

daemon --name=test-daemon -- sleep 200
sleep 60

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
Reply all
Reply to author
Forward
0 new messages