1. 18 Dec, 2017 4 commits
  2. 15 Dec, 2017 1 commit
  3. 14 Dec, 2017 25 commits
  4. 13 Dec, 2017 7 commits
  5. 12 Dec, 2017 3 commits
    • start: fix cgroup namespace preservation · 5af9369b
      Christian Brauner authored
      Prior to this patch we raced with a very short-lived init process. Essentially,
      the init process could exit before we had time to record the cgroup namespace
      causing the container to abort and report ABORTING to the caller when it
      actually started just fine. Let's not do this.
      
      (This uses syscall(SYS_getpid) in the the child to retrieve the pid just in case
      we're on an older glibc version and we end up in the namespace sharing branch
      of the actual lxc_clone() call.)
      
      Additionally this fixes the shortlived tests. They were faulty so far and
      should have actually failed because of the cgroup namespace recording race but
      the ret variable used to return from the function was not correctly
      initialized. This fixes it.
      Furthermore, the shortlived tests used the c->error_num variable to determine
      success or failure but this is actually not correct when the container is
      started daemonized.
      Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
    • tools: exit success when lxc-execute is daemonized · 6c84b599
      Christian Brauner authored
      The error_num value doesn't tell us anything since the container hasn't exited.
      Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
    • start: do not unconditionally dup std{in,out,err} · 5d113f65
      Christian Brauner authored
      Starting with commit
      
          commit c5b93afb
          Author: Li Feng <lifeng68@huawei.com>
          Date:   Mon Jul 10 17:19:52 2017 +0800
      
              start: dup std{in,out,err} to pty slave
      
              In the case the container has a console with a valid slave pty file descriptor
              we duplicate std{in,out,err} to the slave file descriptor so console logging
              works correctly. When the container does not have a valid slave pty file
              descriptor for its console and is started daemonized we should dup to
              /dev/null.
      
              Closes #1646.
      Signed-off-by: 's avatarLi Feng <lifeng68@huawei.com>
      Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
      
      we made std{err,in,out} a duplicate of the slave file descriptor of the console
      if it existed. This meant we also duplicated all of them when we executed
      application containers in the foreground even if some std{err,in,out} file
      descriptor did not refer to a {p,t}ty. This blocked use cases such as:
      
          echo foo | lxc-execute -n -- cat
      
      which are very valid and common with application containers but less common
      with system containers where we don't have to care about this. So my suggestion
      is to unconditionally duplicate std{err,in,out} to the console file descriptor
      if we are either running daemonized - this ensures that daemonized application
      containers with a single bash shell keep on working - or when we are not
      running an application container. In other cases we only duplicate those file
      descriptors that actually refer to a {p,t}ty. This logic is similar to what we
      do for lxc-attach already.
      
      Refers to #1690.
      Closes #2028.
      Reported-by: 's avatarFelix Abecassis <fabecassis@nvidia.com>
      Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>