On Fri, Sep 18, 2015 at 06:08:30PM +0200, Christian Brauner wrote: > When using lxc-start-ephemeral with a command that is supposed to be run in > the > container: > > lxc-start-ephemeral -o aa /bin/sh > > What is the expected behaviour: > > 1) Start the container with its normal init process and then run the > command in the container? > 2) Start the container with just the command running in the container > i.e. similar to lxc-start -n aa -F /bin/sh? > > I cannot test this since lxc-start-ephemeral does not work (don't know why > yet) > on my system. I need to know to think of strategies how to implement this in > C. > Option 1) seems kind of hard and I don't know how to smoothly implement this. > > Christian
The best option seems to be to daemonize the container using c->want_daemonize(c, true); starting it c->start(c, 0, NULL); then calling c->attach_run_wait(c, /* and so on */); to run the command in the container.
signature.asc
Description: PGP signature
_______________________________________________ lxc-devel mailing list lxc-devel@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-devel