1. 04 Apr, 2014 14 commits
  2. 01 Apr, 2014 11 commits
  3. 27 Mar, 2014 1 commit
  4. 26 Mar, 2014 1 commit
  5. 25 Mar, 2014 1 commit
  6. 24 Mar, 2014 4 commits
  7. 23 Mar, 2014 3 commits
  8. 21 Mar, 2014 5 commits
    • fix console stdin,stdout,stderr fds · 6d37caf0
      Dwight Engen authored
      The fds for stdin,stdout,stderr that we were leaving open for /sbin/init
      in the container were those from /dev/tty or lxc.console (if given), which
      wasn't right. Inside the container it should only have access to the pty
      that lxc creates representing the console.
      
      This was noticed because busybox's init was resetting the termio on its
      stdin which was effecting the actual users terminal instead of the pty.
      This meant it was setting icanon so were were not passing keystrokes
      immediately to the pty, and hence command line history/editing wasn't
      working.
      
      Fix by dup'ing the console pty to stdin,stdout,stderr just before
      exec()ing /sbin/init. Fix fd leak in error handling that I noticed while
      going through this code.
      
      Also tested with lxc.console = none, lxc.console = /dev/tty7 and no
      lxc.console specified.
      
      V2: The first version was getting EBADF sometimes on dup2() because
      lxc_console_set_stdfds() was being called after lxc_check_inherited()
      had already closed the fds for the pty. Fix by calling
      lxc_check_inherited() as late as possible which also extends coverage
      of open fd checked code.
      
      V3: Don't move lxc_check_inherited() since it needs to be called while
      the tmp proc mount is still mounted. Move call to lxc_console_set_stdfds()
      just before it.
      Signed-off-by: 's avatarDwight Engen <dwight.engen@oracle.com>
      Acked-by: 's avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>
    • mutex cgmanager access · c59e3bee
      Serge Hallyn authored
      It looks like either libdbus or libnih is showing some corruption with
      threaded access to the cgmanager-client library.  Until we can
      straighten that out, mutex access to the cgmanager.
      
      The worst part of this is having to take and drop the mutex at every
      fork.  This also means that we can't keep a connection open for the
      duration of container startup, since that would deadlock forks.
      
      If we were going to keep it like this, then we could get rid of some
      code in start.c.  However we take a performance hit here which I
      really hope we can rectify soon.
      
      The other approach we could take would be to keep a global count of
      references to cgroup_manager.  Mutex the open, close, and each use
      of the cgroup_manager proxy (and the inc/dec of the refcount).  This
      way we could in fact keep the connection open for the duration of
      container start.  The atfork handler child_fn would have to close
      the connection if open.
      Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com>
      Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
    • debian: Symlink /etc/mtab · 5358f08c
      Holger Amann authored
      /etc/mtab doesn’t exist after bootstrapping a debian container, and will
      be created as regular file after first start.
      
      That leads to at least two errors:
      - output of `mount` is wrong and get messed up the more often you
        start/stop the container
      - /dev/pts/ptmx has wrong permissions
      Signed-off-by: 's avatarHolger Amann <holger@sauspiel.de>
      Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>