]> git.ipfire.org Git - thirdparty/lxc.git/commit
execute: don't exec init, call it
authorTycho Andersen <tycho@tycho.pizza>
Mon, 28 Jun 2021 14:38:48 +0000 (08:38 -0600)
committerChristian Brauner <christian.brauner@ubuntu.com>
Tue, 29 Jun 2021 08:39:36 +0000 (10:39 +0200)
commit96294efb352d8ac695ce000eb32c6f65a005ea76
treefdd172384b24946a380caaf1f0440491d81f334b
parentf1c64634c40a7218165538b89aca320fa258b3c1
execute: don't exec init, call it

Instead of having a statically linked init that we put on the host fs
somewhere via packaging, have to either bind mount in or detect fexecve()
functionality, let's just call it as a library function. This way we don't
have to do any of that.

This also fixes up a bunch of conditions from:

if (quiet)
    fprintf(stderr, "log message");

to

if (!quiet)
    fprintf(stderr, "log message");

:)

and it drops all the code for fexecve() detection and bind mounting our
init in, since we no longer need any of that.

A couple other thoughts:

* I left the lxc-init binary in since we ship it, so someone could be using
  it outside of the internal uses.
* There are lots of unused arguments to lxc-init (including presumably
  --quiet, since nobody noticed the above); those may be part of the API
  though and so we don't want to drop them.

Signed-off-by: Tycho Andersen <tycho@tycho.pizza>
src/lxc/cmd/lxc_init.c
src/lxc/conf.c
src/lxc/execute.c
src/lxc/initutils.c
src/lxc/initutils.h
src/lxc/start.h