summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--upstart/cloud-init-nonet.conf7
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