Permalink
Browse files

Properly handle timeout case in lxc-shutdown

Signed-off-by: Christian Seiler <christian@iwakd.de>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
  • Loading branch information...
1 parent 7f145a6 commit 495c33c8e8329c06e64ce6fca54b9a02a384aba3 @chris-se chris-se committed with stgraber Mar 18, 2013
Showing with 2 additions and 0 deletions.
  1. +2 −0 src/lxc/lxc-shutdown.in
View
@@ -28,6 +28,7 @@ usage() {
}
alarm() {
+ trap 'exit 0' TERM
pid=$1
timeout=$2
sleep $timeout
@@ -139,6 +140,7 @@ while ! lxc-info -n $lxc_name --state-is STOPPED; do
done
if [ $timeout != "-1" ]; then
+ trap - EXIT
kill $alarmpid
fi

0 comments on commit 495c33c

Please sign in to comment.