[lxc-devel] [PATCH 1/1] sleep 0.5s on reboot

Stéphane Graber stgraber at ubuntu.com
Thu Nov 12 16:14:51 UTC 2015


On Thu, Nov 12, 2015 at 07:52:16AM +0000, Serge Hallyn wrote:
> to give lxcfs' cgroup view time out.

Where does that 500ms come from? is it guaranteed that the kernel or
fuse will flush the cache by then?

Also, can't this be implemented as a hook? if so, we could just add this
to the lxcfs config snippet, making this more self-contained.

> 
> Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>
> ---
>  src/lxc/lxccontainer.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c
> index 5207255..14c73b2 100644
> --- a/src/lxc/lxccontainer.c
> +++ b/src/lxc/lxccontainer.c
> @@ -833,6 +833,7 @@ reboot:
>  	if (conf->reboot == 1) {
>  		INFO("container requested reboot");
>  		conf->reboot = 2;
> +		sleep(0.5); // let lxcfs' cgroup view time out
>  		goto reboot;
>  	}
>  
> -- 
> 2.5.0
> 
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel

-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20151112/07486a99/attachment.sig>


More information about the lxc-devel mailing list