Skip to content

Commit

Permalink
Properly handle timeout case in lxc-shutdown
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Seiler <christian@iwakd.de>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
  • Loading branch information
chris-se authored and stgraber committed Mar 19, 2013
1 parent 7f145a6 commit 495c33c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lxc/lxc-shutdown.in
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ usage() {
}

alarm() {
trap 'exit 0' TERM
pid=$1
timeout=$2
sleep $timeout
Expand Down Expand Up @@ -139,6 +140,7 @@ while ! lxc-info -n $lxc_name --state-is STOPPED; do
done

if [ $timeout != "-1" ]; then
trap - EXIT
kill $alarmpid
fi

Expand Down

0 comments on commit 495c33c

Please sign in to comment.