mirror of
git://github.com/lxc/lxc
synced 2025-08-31 00:19:33 +00:00
Properly handle timeout case in lxc-shutdown
Signed-off-by: Christian Seiler <christian@iwakd.de> Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
This commit is contained in:
committed by
Stéphane Graber
parent
7f145a6d0d
commit
495c33c8e8
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user