1. 31 Jul, 2012 33 commits
  2. 03 May, 2012 7 commits
    • lxc-setcap/lxc-setuid: add autoconf expansion for $libexecdir · 00ad19d4
      David Ward authored
      Support new default location for LXCINITDIR.
      Signed-off-by: 's avatarDavid Ward <david.ward@ll.mit.edu>
      Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
    • make help consistent for other scripts · 2775bb4c
      David Ward authored
      Display help information in a consistent format.
      
      Print error messages and help information to stderr. Prefix error
      messages with the name of the script (for easier debugging as part
      of larger scripts).
      
      Allow help information to be printed as a non-root user.
      
      Fix file mode for lxc-checkconfig.in.
      Signed-off-by: 's avatarDavid Ward <david.ward@ll.mit.edu>
      Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
    • rewrite lxc-ps · 8edcbf33
      David Ward authored
      Use bash instead of perl; eliminates final lxc dependency on perl
      (beneficial for minimal operating system environments).
      
      Modify the cgroup search to only use hierarchies that contain one
      or more subsystems. When searching, if a hierarchy contains the
      'ns' subsystem, do not append '/lxc' to the parent cgroup.
      
      Maintain column spacing. Expand container name column as necessary.
      Properly handle spaces in 'ps' output that are not field separators
      (for example, try 'lxc-ps -o pid,args').
      
      Fix file mode in repository.
      Signed-off-by: 's avatarDavid Ward <david.ward@ll.mit.edu>
      Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
    • refresh lxc-netstat · 5e52afd5
      David Ward authored
      Modify the cgroup search to only use hierarchies that contain one
      or more subsystems. When searching, if a hierarchy contains the
      'ns' subsystem, do not append '/lxc' to the parent cgroup.
      
      Change method of bind mounting /proc/<pid>/net onto /proc/net, to
      avoid error "cannot mount block device /proc/<pid>/net read-only".
      
      Check that user is root. Check that container name is specified
      before calling 'exec'.
      
      Update the help information.
      
      Print error messages and help information to stderr.
      
      Make indentation consistent.
      Signed-off-by: 's avatarDavid Ward <david.ward@ll.mit.edu>
      Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
    • refresh lxc-ls · 7ef01413
      David Ward authored
      Add an '--active' option that lists active containers by searching
      cgroups. (Otherwise, the directories in /var/lib/lxc are listed.)
      Modify the cgroup search to only use hierarchies that contain one
      or more subsystems. When searching, if a hierarchy contains the
      'ns' subsystem, do not append '/lxc' to the parent cgroup.
      
      Add a '--help' option that prints the command syntax.
      
      Print error messages and help information to stderr.
      
      Update the documentation.
      Signed-off-by: 's avatarDavid Ward <david.ward@ll.mit.edu>
      Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
    • cgroup: only touch hierarchies that are bound to subsystems · 1d39a065
      David Ward authored
      Obtain a list of subsystems from /proc/cgroups, and ignore hierarchies
      that are not bound to any of them (especially the 'systemd' hierarchy:
      http://www.freedesktop.org/wiki/Software/systemd/PaxControlGroups ).
      Signed-off-by: 's avatarDavid Ward <david.ward@ll.mit.edu>
      Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
    • lxc-attach: unify code for attaching a pid to a cgroup · 460a1cf0
      David Ward authored
      To attach a new pid to the cgroups for an existing container, we can use
      the same method that we did when we started the container: iterate over
      all the mounted cgroup hierarchies; find the cgroup that pid 1 is in for
      each hierarchy; add 'lxc/<name>' to the end of it; then write the pid to
      the 'tasks' file in that cgroup. (The only difference is that we do not
      create the cgroup again.) Note that we follow exactly the same iteration
      pattern to delete our cgroups when a container is shutdown.
      
      There may be situations where additional cgroups hierarchies are mounted
      after the container is started, or the cgroup for pid 1 gets reassigned.
      But we currently don't handle any of these cases in the shutdown code or
      anywhere else, so it doesn't make sense to try to handle these cases for
      lxc-attach by itself. Aside from simplifying the code, this change makes
      it easier to solve a different problem: ignoring hierarchies that are
      not bound to any subsystems (like 'systemd').
      Signed-off-by: 's avatarDavid Ward <david.ward@ll.mit.edu>
      Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>