leamas / lpf

lpf - Local Package Factory
MIT License
61 stars 6 forks source link

lpf scan: race condition on exit #13

Closed leamas closed 10 years ago

leamas commented 10 years ago

in 0-12, when doing a lpf scan there's occasionally a bad exit code due to a race condition iin lpf kill-pgroup.

pgroup=$(ps -ho pgid $$)
members=$( ps  --sid $pgroup -ho pid)
children=${members/$$/}
if [ -n "${children/ /}" ]; then  kill -TERM $children; fi

Here, the members might be gone before they are killed. The last line should thus ignore errors.

leamas commented 10 years ago

Fixed in all branches. closing