1. 04 Apr, 2014 7 commits
  2. 03 Apr, 2014 1 commit
    • fix lxc-info printing duplicate lines · e2426f0b
      Dwight Engen authored
      When lxc-info's stdout is not line buffered (ie. "lxc-info -n foo |more")
      the first three lines will be duplicated. This is because c->get_ips()
      comes next and it forks and the child will exit() causing its fds to be
      closed which flushes out its (fork duplicated) stdio buffers. The lines are
      then duplicated when the parent actually gets around to flushing out its
      stdio. This causes problems for programs (such as the lxc-webpanel) which
      are popen()ing lxc-info.
      
      The fix here isn't necessarily the right one, but does show what the
      problem is. Seems like maybe we should fix this inside of get_ips(), for
      other API callers as well.
      Signed-off-by: 's avatarDwight Engen <dwight.engen@oracle.com>
      Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com>
  3. 02 Apr, 2014 6 commits
  4. 01 Apr, 2014 5 commits
  5. 31 Mar, 2014 2 commits
  6. 29 Mar, 2014 2 commits
  7. 27 Mar, 2014 2 commits
  8. 26 Mar, 2014 1 commit
  9. 25 Mar, 2014 1 commit
  10. 24 Mar, 2014 4 commits
  11. 23 Mar, 2014 4 commits
  12. 21 Mar, 2014 5 commits
    • fix console stdin,stdout,stderr fds · 0d9acb99
      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 · 79bff4f8
      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 · 23e88083
      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>