]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Properly handle timeout case in lxc-shutdown
authorChristian Seiler <christian@iwakd.de>
Mon, 18 Mar 2013 19:06:31 +0000 (20:06 +0100)
committerStéphane Graber <stgraber@ubuntu.com>
Tue, 19 Mar 2013 13:18:40 +0000 (09:18 -0400)
Signed-off-by: Christian Seiler <christian@iwakd.de>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
src/lxc/lxc-shutdown.in

index fdcade2a419d4d84d99522f8007349c63694dc81..d82cebf32662d16a159c4a81e53ae78a877a8026 100644 (file)
@@ -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