Comment 4 for bug 918327

Revision history for this message
Serge Hallyn (serge-hallyn) wrote : Re: lxc-start exits success on failure when non-root

Ok, I'm actually not sure what we should do about this.

'-d' doesn't just mean don't show a console, it means daemonize. It does this by calling daemon(3), which forks(), lets the child continue, and exits success.

We could toss extra checks in before the call to daemon(3) to check for privilege, but there are plenty of other reasons why the start could fail.

So it seems we can do one of two things:

  1. rewrite lxc-start so that it manually forks and waits for a message from the lxc monitor saying the container started, and only then exit

  2. tell users that 'lxc-start -d' provides no information about the success of starting the container, and that if you care, you should call something like

   lxc-wait -n container -s RUNNING

     after the lxc-start to make sure it succeeded.