mirror of
git://github.com/lxc/lxc
synced 2025-09-02 02:29:32 +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() {
|
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
|
|||||||
done
|
done
|
||||||
|
|
||||||
if [ $timeout != "-1" ]; then
|
if [ $timeout != "-1" ]; then
|
||||||
|
trap - EXIT
|
||||||
kill $alarmpid
|
kill $alarmpid
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user