[lxc-devel] [Spam-Wahrscheinlichkeit=89]Re: RFC: How to detect that a Container have competed to boot?
Serge Hallyn
serge.hallyn at canonical.com
Fri Jun 29 12:51:23 UTC 2012
Quoting Jäkel, Guido (G.Jaekel at dnb.de):
> Dear Serge,
>
> >I don't know of a generic way this could be done in lxc.
>
> But it is desirable, right?
Well in a sense it's equivalent to the halting problem. A solution
to which is desirable but not achievable. We've had similar discussions
about service readiness for upstart. Unless there's a new convention
for the service to inform you that it is ready, you're only making
guesses. (I.e. pid files, which often are created before the service
is actually ready).
> > However, for your specific containers, you could redirect console to a file and have a script watch for a login prompt there?
>
> One can think about a whole bunch of ways to reach the aim in a proprietary way winthin minutes. But I don't have to tell you why this is not a lasting solution.
>
>
> Said that, it seem that your answer already includes an idea for a generic approach: The virtual console feature! If I try to attach using lxc-console, it will fail or block until the containers console becomes ready.
Right - which can work for containers with consoles. It's not 100% generic.
> I may try to set up a helper script "lxc-wait_until_booted" for this purpose.
Sounds good.
> But as a build-in, the lxc-start process may watch after start if the virtual console becomes available and then either set a new container status or another "flag", what might be made available via the lxc-info command.
I'll wait for others to give their opinions. The only problem I have is that the
container has no consoles, it won't enter that state...
-serge
More information about the lxc-devel
mailing list