[lxc-devel] [PATCH 0/3] The poor man's attach

Greg Kurz gkurz at fr.ibm.com
Wed Oct 26 15:13:11 UTC 2011


Often people want to launch a command in an already
running container. This can be achieved with the lxc-attach
command, provided you have a patched kernel with full
setns() support.

For those who won't rebuild a kernel, we introduce
the lxc-rexec command to be used in place of
lxc-attach. The principle is to embed a minimal
unix socket server in lxc-init that launch commands when
asked to by a lxc-rexec client.

For the moment, this feature only works for application
containers started with lxc-execute. Some more work
would be needed to have something similar for system
containers (and by the way, system containers with network
support may rely on rsh-like services to do the trick).

The first two patches add a mainloop and logging features
to lxc-init, and the last patch brings lxc-rexec.

---

Greg Kurz (3):
      lxc: introduce lxc-rexec
      lxc-init: use lxc logging infrastructure
      lxc-init: use lxc_mainloop


 configure.ac          |    1 
 doc/Makefile.am       |    1 
 doc/lxc-rexec.sgml.in |  151 ++++++++++++++
 src/lxc/Makefile.am   |    7 -
 src/lxc/arguments.h   |    3 
 src/lxc/error.c       |   23 ++
 src/lxc/error.h       |    3 
 src/lxc/execute.c     |   66 ++++++
 src/lxc/execute.h     |   28 +++
 src/lxc/lxc.h         |    1 
 src/lxc/lxc_execute.c |    3 
 src/lxc/lxc_init.c    |  511 ++++++++++++++++++++++++++++++++++++++-----------
 src/lxc/lxc_rexec.c   |  337 ++++++++++++++++++++++++++++++++
 13 files changed, 1014 insertions(+), 121 deletions(-)
 create mode 100644 doc/lxc-rexec.sgml.in
 create mode 100644 src/lxc/execute.h
 create mode 100644 src/lxc/lxc_rexec.c

-- 
Greg




More information about the lxc-devel mailing list