[lxc-devel] [PATCH 2/9] lxc-attach: use execvp instead of execve

2012-03-05 Thread David Ward
execvp does not require specifying the full path to the executable (e.g., "ls" instead of "/bin/ls"), making the operation of 'lxc-attach' consistent with 'lxc-start' and 'lxc-execute'. Signed-off-by: David Ward --- src/lxc/lxc_attach.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletion

[lxc-devel] [PATCH 6/9] utmp: support non-rootfs configuration

2012-03-05 Thread David Ward
Having a rootfs is not a necessary condition for monitoring utmp, since /var or /var/run can just be remounted inside the container instead. We should rely on the other two conditions already in place to decide whether to monitor the utmp file: - the container was started with 'lxc-start', which

[lxc-devel] [PATCH 3/9] lxc-ls: only list active containers

2012-03-05 Thread David Ward
Originally, lxc-ls listed all containers by printing the directory names in /var/lib/lxc. After commit 65cb447f9b8d1ac8dcf9df24a4f877180444f003, lxc-ls now finds and prints active containers by searching for open UNIX sockets named '/var/lib/lxc//command'. However, all containers are still printed

[lxc-devel] [PATCH 5/9] utmp: do not set conf->need_utmp_watch if CAP_SYS_BOOT is not found

2012-03-05 Thread David Ward
If CAP_SYS_BOOT is not found in the kernel, the existing value for conf->need_utmp_watch should be left intact (which will be '1' for containers started with 'lxc-start', or '0' for containers started with 'lxc-execute'). Signed-off-by: David Ward --- src/lxc/start.c |1 - 1 files changed, 0

[lxc-devel] [PATCH 7/9] cgroup: rearrange code blocks

2012-03-05 Thread David Ward
Avoid nesting and improve readability. Signed-off-by: David Ward --- src/lxc/cgroup.c | 66 - 1 files changed, 30 insertions(+), 36 deletions(-) diff --git a/src/lxc/cgroup.c b/src/lxc/cgroup.c index cc3910a..c915b52 100644 --- a/src/lxc/cgr

[lxc-devel] [PATCH 9/9] cgroup: only touch hierarchies that are bound to subsystems

2012-03-05 Thread David Ward
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: David Ward --- src/lxc/cgroup.c | 50 +++

[lxc-devel] [PATCH 4/9] lxc-ls: tighten regex search on open sockets

2012-03-05 Thread David Ward
lxc-ls returns a list of active containers by searching for UNIX sockets named '/var/lib/lxc//command'. Make the regular expression tighter for this search, to avoid inadvertently picking up other sockets. Signed-off-by: David Ward --- src/lxc/lxc-ls.in |4 ++-- 1 files changed, 2 insertions

[lxc-devel] [PATCH 0/9] Assorted fixes against lxc 0.8.0-rc1

2012-03-05 Thread David Ward
The following patches address a few issues I discovered while building or using lxc, including compatibility with systemd. They were tested on top of lxc 0.8.0-rc1 under Fedora 16. Please let me know if you have any questions or concerns. David Ward (9): use syscall numbers from Linux kernel he

[lxc-devel] [PATCH 1/9] use syscall numbers from Linux kernel headers

2012-03-05 Thread David Ward
__NR_setns is defined in the Linux kernel headers in linux/unistd.h. The full Linux kernel sources are not necessary for compilation. Signed-off-by: David Ward --- config/linux.m4 | 76 --- configure.ac|8 ++--- src/lxc/Makefile.a

[lxc-devel] [PATCH 8/9] lxc-attach: unify code for attaching a pid to a cgroup

2012-03-05 Thread David Ward
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/' to the end of it; then write the pid to the 'tasks' fi

[lxc-devel] [GIT] lxc branch, master, updated. f9d0d2cbbf401ffb74c251e75581174d91a02cfc

2012-03-05 Thread Daniel Lezcano
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "lxc". The branch, master has been updated via f9d0d2cbbf401ffb74c251e75581174d91a02cfc (commit) via fc3c7f7f6e9d8adfc4be9431

Re: [lxc-devel] [PATCH 3/9] lxc-ls: only list active containers

2012-03-05 Thread Daniel Lezcano
On 03/05/2012 02:34 PM, David Ward wrote: > Originally, lxc-ls listed all containers by printing the directory names > in /var/lib/lxc. After commit 65cb447f9b8d1ac8dcf9df24a4f877180444f003, > lxc-ls now finds and prints active containers by searching for open UNIX > sockets named '/var/lib/lxc//co