diff options
author | Scott Moser <smoser@ubuntu.com> | 2013-03-26 15:40:29 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2013-03-26 15:40:29 -0400 |
commit | be0041e7c7fd6ce5ffc1c9c54893b715bcab6358 (patch) | |
tree | 07587f18c3b46b52cbfa74458f00ad2989c2d96f | |
parent | a2113a70e9cf4c1cc00ec67fe3411b5696686f46 (diff) | |
download | vyos-cloud-init-be0041e7c7fd6ce5ffc1c9c54893b715bcab6358.tar.gz vyos-cloud-init-be0041e7c7fd6ce5ffc1c9c54893b715bcab6358.zip |
cloud-init-nonet.conf: handle case where sleep died
In starting containers in lxc, I was seeing errors like:
/proc/self/fd/9: 24: kill: No such process
Which indicated the sleep pid had already died.
I'm not sure how or why it was dead, but this just is less annoying in that
case.
-rw-r--r-- | upstart/cloud-init-nonet.conf | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/upstart/cloud-init-nonet.conf b/upstart/cloud-init-nonet.conf index 36b99fb5..a94b1474 100644 --- a/upstart/cloud-init-nonet.conf +++ b/upstart/cloud-init-nonet.conf @@ -31,7 +31,12 @@ script handle_sigterm() { # if we received sigterm and static networking is up then it probably # came from upstart as a result of 'stop on static-network-up' - [ -z "$SLEEP_CHILD" ] || kill $SLEEP_CHILD + if [ -n "$SLEEP_CHILD" ]; then + if ! kill $SLEEP_CHILD 2>/dev/null; then + [ ! -d "/proc/$SLEEP_CHILD" ] || + msg "hm.. failed to kill sleep pid $SLEEP_CHILD" + fi + fi if static_network_up; then msg "static networking is now up" exit 0 |