Commit 495c33c8 by Christian Seiler Committed by Stéphane Graber

Properly handle timeout case in lxc-shutdown

parent 7f145a6d
...@@ -28,6 +28,7 @@ usage() { ...@@ -28,6 +28,7 @@ usage() {
} }
alarm() { alarm() {
trap 'exit 0' TERM
pid=$1 pid=$1
timeout=$2 timeout=$2
sleep $timeout sleep $timeout
...@@ -139,6 +140,7 @@ while ! lxc-info -n $lxc_name --state-is STOPPED; do ...@@ -139,6 +140,7 @@ while ! lxc-info -n $lxc_name --state-is STOPPED; do
done done
if [ $timeout != "-1" ]; then if [ $timeout != "-1" ]; then
trap - EXIT
kill $alarmpid kill $alarmpid
fi fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment