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
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
__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
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
v2: Add changes to scripts (including new '--active' flag for lxc-ls)
The following patches address a number of different 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
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.
Add a '--help' option that prints the command syntax.
Print error messages and
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
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 +++
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
Modify the cgroup search to only use hierarchies that contain one
or more subsystems.
Change method of bind mounting /proc//net onto /proc/net, to
avoid error "cannot mount block device /proc//net read-only".
Check that user is root. Check that container name is specified
before calling 'exec'.
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.
Maintain column spacing. Expand container name column as necessary.
Properly handle space
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.
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
On 03/05/2012 06:01 PM, Daniel Lezcano wrote:
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
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
---
15 matches
Mail list logo