[lxc-devel] [PATCH] Only bring up network interface if IFF_UP is set

2011-01-16 Thread David Ward
Each network interface was brought up regardless of the configuration, as the wrong boolean operator was being used to test the IFF_UP flag. Signed-off-by: David Ward --- src/lxc/conf.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c

Re: [lxc-devel] [PATCH] fix broadcast compution

2011-02-12 Thread David Ward
Daniel, On 02/06/2010 03:29 PM, Daniel Lezcano wrote: >diff --git a/src/lxc/confile.c b/src/lxc/confile.c >index 4d81ac6..7c72752 100644 >--- a/src/lxc/confile.c >+++ b/src/lxc/confile.c >@@ -423,9 +423,8 @@ static int config_network_ipv4(const char *key, char >*value, > * prefix and addres

[lxc-devel] [PATCH] Watch utmp if /var/run is not shared

2011-02-28 Thread David Ward
utmp. This replaces the check for "lxc.rootfs" in the configuration. Signed-off-by: David Ward --- src/lxc/utmp.c | 21 - 1 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/lxc/utmp.c b/src/lxc/utmp.c index 691c3ef..3356396 100644 --- a/src/l

[lxc-devel] [PATCHv2] Watch utmp if /var/run is not shared

2011-02-28 Thread David Ward
, lxc checks to see if "/var/run" is shared between the container and the system by comparing the device and inode numbers. If not, lxc will watch utmp. This replaces the check for "lxc.rootfs". Signed-off-by: David Ward --- src/lxc/utmp.c | 21 - 1 fil

[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

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

2012-03-05 Thread David Ward
27;, which indicates that it has a real init process and is expected to write to a utmp file - support for CAP_SYS_BOOT was not found in the kernel, which would otherwise supersede utmp monitoring Signed-off-by: David Ward --- src/lxc/utmp.c |4 1 files changed, 0 insert

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

2012-03-05 Thread David Ward
ll printed using the old method as well, so now the active containers just get printed twice. Assuming that the intention of the above commit was to only list active containers, do not print the directory names in /var/lib/lxc any longer. Signed-off-by: David Ward --- src/lxc/lxc-ls.in |2 -

[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 ---

[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

[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/cgrou

[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

[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

[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

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

2012-03-05 Thread David Ward
r to solve a different problem: ignoring hierarchies that are not bound to any subsystems (like 'systemd'). Signed-off-by: David Ward --- src/lxc/attach.c | 110 + src/lxc/attach.h |9 src/lxc/cgroup.c | 91 ++

[lxc-devel] [PATCHv2 02/12] lxc-attach: use execvp instead of execve

2012-03-11 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

[lxc-devel] [PATCHv2 04/12] utmp: support non-rootfs configuration

2012-03-11 Thread David Ward
27;, which indicates that it has a real init process and is expected to write to a utmp file - support for CAP_SYS_BOOT was not found in the kernel, which would otherwise supersede utmp monitoring Signed-off-by: David Ward --- src/lxc/utmp.c |4 1 files changed, 0 insert

[lxc-devel] [PATCHv2 01/12] use syscall numbers from Linux kernel headers

2012-03-11 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

[lxc-devel] [PATCHv2 05/12] cgroup: rearrange code blocks

2012-03-11 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

[lxc-devel] [PATCHv2 00/12] Assorted fixes against lxc 0.8.0-rc1

2012-03-11 Thread David Ward
f you have any questions or concerns. David Ward (12): use syscall numbers from Linux kernel headers lxc-attach: use execvp instead of execve utmp: do not set conf->need_utmp_watch if CAP_SYS_BOOT is not found utmp: support non-rootfs configuration cgroup: rearrange code blocks lxc-

[lxc-devel] [PATCHv2 08/12] refresh lxc-ls

2012-03-11 Thread David Ward
Print error messages and help information to stderr. Update the documentation. Signed-off-by: David Ward --- doc/lxc-ls.sgml.in | 17 ++- src/lxc/lxc-ls.in | 112 +++- 2 files changed, 98 insertions(+), 31 deletions(-) diff --git a/doc/lxc-

[lxc-devel] [PATCHv2 06/12] lxc-attach: unify code for attaching a pid to a cgroup

2012-03-11 Thread David Ward
r to solve a different problem: ignoring hierarchies that are not bound to any subsystems (like 'systemd'). Signed-off-by: David Ward --- src/lxc/attach.c | 110 + src/lxc/attach.h |9 src/lxc/cgroup.c | 91 ++

[lxc-devel] [PATCHv2 07/12] cgroup: only touch hierarchies that are bound to subsystems

2012-03-11 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/cgrou

[lxc-devel] [PATCHv2 03/12] utmp: do not set conf->need_utmp_watch if CAP_SYS_BOOT is not found

2012-03-11 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 ---

[lxc-devel] [PATCHv2 09/12] refresh lxc-netstat

2012-03-11 Thread David Ward
ling 'exec'. Update the help information. Print error messages and help information to stderr. Make indentation consistent. Signed-off-by: David Ward --- src/lxc/lxc-netstat.in | 141 +++- 1 files changed, 91 insertions(+), 50 deletions(-)

[lxc-devel] [PATCHv2 10/12] rewrite lxc-ps

2012-03-11 Thread David Ward
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: David Ward --- src/lxc/lxc-ps.in | 311 +++-- 1 files changed, 109 insertions(+), 202 delet

[lxc-devel] [PATCHv2 11/12] make help consistent for other scripts

2012-03-11 Thread David Ward
. Signed-off-by: David Ward --- src/lxc/lxc-checkconfig.in | 15 +++ src/lxc/lxc-clone.in | 70 +++- src/lxc/lxc-create.in | 96 --- src/lxc/lxc-destroy.in | 40 -- src/lxc/lxc-setcap.in

[lxc-devel] [PATCHv2 12/12] lxc-setcap/lxc-setuid: add autoconf expansion for $libexecdir

2012-03-11 Thread David Ward
Support new default location for LXCINITDIR. --- configure.ac |1 + src/lxc/lxc-setcap.in |1 + src/lxc/lxc-setuid.in |1 + 3 files changed, 3 insertions(+), 0 deletions(-) diff --git a/configure.ac b/configure.ac index 526d22d..5c47dfc 100644 --- a/configure.ac +++ b/configu

[lxc-devel] [PATCHv2 w/SignOff 12/12] lxc-setcap/lxc-setuid: add autoconf expansion for $libexecdir

2012-03-11 Thread David Ward
Support new default location for LXCINITDIR. Signed-off-by: David Ward --- configure.ac |1 + src/lxc/lxc-setcap.in |1 + src/lxc/lxc-setuid.in |1 + 3 files changed, 3 insertions(+), 0 deletions(-) diff --git a/configure.ac b/configure.ac index 526d22d..5c47dfc 100644

[lxc-devel] [PATCHv3 05/14] cgroup: additional fix for deprecated ns subsystem

2012-03-21 Thread David Ward
When a hierarchy contains the 'ns' subsystem, do not append '/lxc' to the parent cgroup. Update surrounding comments for consistency. Signed-off-by: David Ward --- src/lxc/cgroup.c | 13 +++-- 1 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/lx

[lxc-devel] [PATCHv3 12/14] rewrite lxc-ps

2012-03-21 Thread David Ward
27;/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: D

[lxc-devel] [PATCHv3 03/14] utmp: do not set conf->need_utmp_watch if CAP_SYS_BOOT is not found

2012-03-21 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 ---

[lxc-devel] [PATCHv3 06/14] lxc-cgroup: use correct terminology

2012-03-21 Thread David Ward
lxc-cgroup gets or sets the value of a state object (such as 'cpuset.cpus'), not the value of a subsystem (which would be just 'cpuset'). Signed-off-by: David Ward --- doc/lxc-cgroup.sgml.in | 31 +-- src/lxc/cgroup.c |4 ++--

[lxc-devel] [PATCHv3 09/14] cgroup: only touch hierarchies that are bound to subsystems

2012-03-21 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/cgrou

[lxc-devel] [PATCHv3 02/14] lxc-attach: use execvp instead of execve

2012-03-21 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

[lxc-devel] [PATCHv3 01/14] use syscall numbers from Linux kernel headers

2012-03-21 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

[lxc-devel] [PATCHv3 10/14] refresh lxc-ls

2012-03-21 Thread David Ward
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: David Ward --- doc/lxc-ls.sgml.in |

[lxc-devel] [PATCHv3 00/14] Assorted fixes against lxc 0.8.0-rc2

2012-03-21 Thread David Ward
ot feature patches). They were tested on top of lxc 0.8.0-rc2 under both Fedora 14 and Fedora 16. I am submitting them for inclusion in lxc 0.8.0. Please let me know if you have any questions or concerns. David Ward (14): use syscall numbers from Linux kernel headers lxc-attach: use execvp

[lxc-devel] [PATCHv3 08/14] lxc-attach: unify code for attaching a pid to a cgroup

2012-03-21 Thread David Ward
r to solve a different problem: ignoring hierarchies that are not bound to any subsystems (like 'systemd'). Signed-off-by: David Ward --- src/lxc/attach.c | 110 + src/lxc/attach.h |9 src/lxc/cgroup.c | 97 +

[lxc-devel] [PATCHv3 11/14] refresh lxc-netstat

2012-03-21 Thread David Ward
mount block device /proc//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: David

[lxc-devel] [PATCHv3 04/14] utmp: support non-rootfs configuration

2012-03-21 Thread David Ward
27;, which indicates that it has a real init process and is expected to write to a utmp file - support for CAP_SYS_BOOT was not found in the kernel, which would otherwise supersede utmp monitoring Signed-off-by: David Ward --- src/lxc/utmp.c |4 1 files changed, 0 insert

[lxc-devel] [PATCHv3 07/14] cgroup: rearrange code blocks

2012-03-21 Thread David Ward
Avoid nesting and improve readability. Signed-off-by: David Ward --- src/lxc/cgroup.c | 70 - 1 files changed, 32 insertions(+), 38 deletions(-) diff --git a/src/lxc/cgroup.c b/src/lxc/cgroup.c index f50c74a..8d70951 100644 --- a/src/lxc

[lxc-devel] [PATCHv3 13/14] make help consistent for other scripts

2012-03-21 Thread David Ward
. Signed-off-by: David Ward --- src/lxc/lxc-checkconfig.in | 15 +++ src/lxc/lxc-clone.in | 70 +++- src/lxc/lxc-create.in | 96 --- src/lxc/lxc-destroy.in | 40 -- src/lxc/lxc-setcap.in

[lxc-devel] [PATCHv3 14/14] lxc-setcap/lxc-setuid: add autoconf expansion for $libexecdir

2012-03-21 Thread David Ward
Support new default location for LXCINITDIR. Signed-off-by: David Ward --- configure.ac |1 + src/lxc/lxc-setcap.in |1 + src/lxc/lxc-setuid.in |1 + 3 files changed, 3 insertions(+), 0 deletions(-) diff --git a/configure.ac b/configure.ac index c2bf4b0..0c8aa69 100644

[lxc-devel] [PATCH] lxc-attach: Clear environment and set container=lxc

2013-03-20 Thread David Ward
The child process's environment should be manipulated the same way by lxc-attach as it would be by lxc-start or lxc-execute. Signed-off-by: David Ward --- src/lxc/attach.c | 15 +++ src/lxc/attach.h |1 + src/lxc/lxc_attach.c |5 + 3 files change

[lxc-devel] [PATCH] Set all mounts to MS_SLAVE when starting a container without a rootfs

2013-03-26 Thread David Ward
gured. Signed-off-by: David Ward --- src/lxc/conf.c |7 ++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c index 965a0d2..6b3f318 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -1129,8 +1129,13 @@ static int setup_rootfs(struct lxc