[lxc-devel] [PATCH 2/2] Properly handle timeout case in lxc-shutdown

Serge Hallyn serge.hallyn at ubuntu.com
Mon Mar 18 19:28:30 UTC 2013


Quoting Christian Seiler (christian at iwakd.de):
> Signed-off-by: Christian Seiler <christian at iwakd.de>

Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>

> ---
>  src/lxc/lxc-shutdown.in |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/lxc/lxc-shutdown.in b/src/lxc/lxc-shutdown.in
> index fdcade2..d82cebf 100644
> --- a/src/lxc/lxc-shutdown.in
> +++ b/src/lxc/lxc-shutdown.in
> @@ -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
>  
> -- 
> 1.7.10.4
> 
> 
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_mar
> _______________________________________________
> Lxc-devel mailing list
> Lxc-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-devel




More information about the lxc-devel mailing list