]>
git.proxmox.com Git - mirror_lxc.git/log
Michel Normand [Fri, 24 Jul 2009 13:25:45 +0000 (15:25 +0200)]
close also inherited fd in lxc-execute
This is a complement of previous patches
d983b93c3ad860fa22ef760ae27a944d6000e35a
and
af795875875de1855ee251ba530fbe2b53463f6e about inherited fd.
Here this is required for the lxc-execute that have a specific
lxc-init procress.
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Fri, 24 Jul 2009 13:25:45 +0000 (15:25 +0200)]
display an explicit warning when netlink headers are missing
"netlink headers not found" implicitely means we have to install the
kernel headers. Make this explicit.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Fri, 24 Jul 2009 13:25:45 +0000 (15:25 +0200)]
add some traces in the code for the logger
Add some traces in the code, so we are able to follow the execution
of the start command with the logger.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Fri, 24 Jul 2009 13:25:44 +0000 (15:25 +0200)]
fix cgroup trace
The trace is displayed either if the setting fails, change that by
displaying the trace when the setting is successful.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Fri, 24 Jul 2009 13:25:43 +0000 (15:25 +0200)]
change version to 0.6.3
Increment to the 0.6.3 version.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Wed, 22 Jul 2009 17:39:18 +0000 (19:39 +0200)]
Specify in the debian script an extra fstab file
Allow the user to specify an extra fstab file to be added in the
debian configuration. So some optimisations can be done for sharing
objects.
eg: /var/cache/apt/archives mounted in <rootfs>/var/cache/apt/archives
Signed-of-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Wed, 22 Jul 2009 17:39:18 +0000 (19:39 +0200)]
add clone2 for ia64
Added clone2 for container creation on ia64.
Not tested as I don't have such architecture.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Wed, 22 Jul 2009 17:39:17 +0000 (19:39 +0200)]
make use of the logging facility and add some traces
Now we have a logging facility, let's use it and add some traces in
the code.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Mon, 20 Jul 2009 15:57:31 +0000 (17:57 +0200)]
isolate the shmfs for the container
The /dev/shm is not isolated for application container, so mount it in
the container.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Mon, 20 Jul 2009 15:57:31 +0000 (17:57 +0200)]
fix closed fd when they are inherited
This patch fix a problem with the commit
d983b93c3ad860fa22ef760ae27a944d6000e35a
When the lxc daemonize, it closes fd 0, 1 and 2. But these ones are coming from
inherited fd and they are already in the inherited list of fd. When lxc creates
some file descriptors, they have the number of the previous inherited file
descriptor, so they are closed when we close all the inherited file descriptors.
In order to fix that, the lxc_close_inherited_fd function has been implemented
to close an inherited fd and remove it from the list.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Thu, 16 Jul 2009 14:38:15 +0000 (16:38 +0200)]
Remove the a previous cgroup
As a previous run may have created a cgroup but died unexpectedly,
the cgroup can be still there when we try to launch the container
again with the same name. This patch removes the directory if it is
present, if this one is not owned by caller or it is in use (that should
not happen), the rmdir will fail with the corresponding errno.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Thu, 16 Jul 2009 14:38:15 +0000 (16:38 +0200)]
encapsulate lxc_handler
Move the lxc_handler structure definition in the body file and
dynamically allocate it.
lxc_handler becomes an opaque structure for the user.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Thu, 16 Jul 2009 14:38:15 +0000 (16:38 +0200)]
Remove useless initialization
The structure is cleared by the lxc_init function.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Michel Normand [Wed, 15 Jul 2009 21:48:22 +0000 (23:48 +0200)]
lxc-start should not hold inheritited fds
This patch makes the intermediate lxc processes to close the
inherited file descriptor. The child process will inherit these fd
in any case and that will be up to it to handle them.
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Daniel Lezcano [Wed, 15 Jul 2009 21:48:22 +0000 (23:48 +0200)]
use the lxc arguments dup in lxc_execute
Now we have a helper to dup the arguments, let's use it.
The code gains in clarity.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Wed, 15 Jul 2009 21:48:22 +0000 (23:48 +0200)]
add a helper to dup the lxc arguments
Add a helper to dup the lxc_arguments, so the code making
the copy of the arguments will be more clear.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Wed, 15 Jul 2009 21:48:22 +0000 (23:48 +0200)]
cleanup lxc-init
Make some cleanup around the parameters of lxc-init.
The option mount procfs is not needed as we want to do that
all the time.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Mon, 13 Jul 2009 21:12:10 +0000 (23:12 +0200)]
detect a cgroup named 'lxc'
This patch makes lxc to detect a specific cgroup dedicated to lxc
which is mounted with the lxc name. That allows to mount different
cgroup in different places with different options (aka subsystems)
and assign one to be used by lxc. If no such mount point is found,
the first cgroup mount point is used.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Michel Normand [Mon, 13 Jul 2009 21:12:09 +0000 (23:12 +0200)]
lxc-execute or lxc-start to fail if cgroup not mounted
Before this patch a container was able to be started
without mounted cgroup. (only a warning was logged)
But the lxc-ps is using the /proc/<pid>/cgroup to identify
the lxc container in which pid is running.
So to be consistent between all lxc command I force an error
if cgroup is not mounted at time of lxc-execute or lxc-start.
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Fri, 10 Jul 2009 06:58:27 +0000 (08:58 +0200)]
create the lxc directory with lxc-setcap
There are several cases:
* we run the lxc-create as root, the @path@/var/lib/lxc will be created
* we run the lxc-create as non-root, the creation of the directory will
fail with "permission denied", so we should call lxc-setcap before
* we run lxc-setcap (always as root), we create the directory and set
the permission for everyone.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Fri, 10 Jul 2009 06:58:27 +0000 (08:58 +0200)]
don't create the lxc directory at rpm installation
Don't create the directory when we install the lxc package.
This is handled by lxc-create.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Ryousei Takano [Fri, 10 Jul 2009 06:58:27 +0000 (08:58 +0200)]
Remove install-exec-local rule
Hi Daniel and all,
I am trying to run LXC on the CentOS 5.3 and the Linux kernel 2.6.30.
I found a problem with running the rpmbuild command. The error message
is shown below:
$ rpmbuild -bb lxc.spec
<snip>
/usr/bin/install -c 'lxc-setcap' '/var/tmp/lxc-0.6.2-build/usr/bin/lxc-setcap'
/usr/bin/install -c 'lxc-version' '/var/tmp/lxc-0.6.2-build/usr/bin/lxc-version'
mkdir: cannot create directory `/var/lib/lxc': Permission denied
make[3]: *** [install-exec-local] Error 1
make[3]: Leaving directory `/home/ryousei/rpm/BUILD/lxc-0.6.2/src/lxc'
make[2]: *** [install-am] Error 2
make[2]: Leaving directory `/home/ryousei/rpm/BUILD/lxc-0.6.2/src/lxc'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/home/ryousei/rpm/BUILD/lxc-0.6.2/src'
make: *** [install-recursive] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.26914 (%install)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.26914 (%install)
This patch removes 'install-exec-local' rule in Makefile. It is not necessary,
and it causes rpmbuild failure on the CentOS 5.3.
Signed-off-by: Ryousei Takano <takano-ryousei@aist.go.jp>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Tue, 7 Jul 2009 20:53:05 +0000 (22:53 +0200)]
remove fork_ns code
This code is no longer used, remove it.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Tue, 7 Jul 2009 20:51:18 +0000 (22:51 +0200)]
replace fork_ns by lxc_clone
Make use of the lxc_clone function and do no longer
use the fork_ns function.
The lxc-unshare utility has been changed to always do a fork.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Tue, 7 Jul 2009 20:51:18 +0000 (22:51 +0200)]
use glibc clone instead of clone syscall
This patch replaces the clone syscall by the glibc clone making
the code not tied with the syscalls number declaration.
The unshare syscall has been removed as it is not interesting.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Fri, 3 Jul 2009 13:25:45 +0000 (15:25 +0200)]
Fix missing capability fowner to manipulate /dev/pts/ptmx
This file may be without any permission
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Filippo Giunchedi [Thu, 2 Jul 2009 13:42:18 +0000 (15:42 +0200)]
Add file capabilities to kernel options
Point users in documentation to also enable POSIX capability for
dropping CAP_BOOT.
Signed-off-by: Filippo Giunchedi <filippo@esaurito.net>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Filippo Giunchedi [Thu, 2 Jul 2009 13:42:18 +0000 (15:42 +0200)]
Add check for CONFIG_SECURITY_FILE_CAPABILITIES
This might result in more evident lack of support for POSIX capabilities
enabled as pointed in documentation
Signed-off-by: Filippo Giunchedi <filippo@esaurito.net>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Filippo Giunchedi [Thu, 2 Jul 2009 13:42:18 +0000 (15:42 +0200)]
Clarify setcap advice/warning messages
Probably a mention to libcap-2 is worth keeping, though it might be
clearer to point to setcap binary directly.
Signed-off-by: Filippo Giunchedi <filippo@esaurito.net>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Filippo Giunchedi [Thu, 2 Jul 2009 13:42:18 +0000 (15:42 +0200)]
Include /sbin in PATH for setcap
Rationale: some distributions don't include /sbin in PATH for regular
users, thus setcap might not be found during configure
Signed-off-by: Filippo Giunchedi <filippo@esaurito.net>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Filippo Giunchedi [Thu, 2 Jul 2009 13:42:18 +0000 (15:42 +0200)]
Update kernel config options location
These options appear in 2.6.29 in different locations, update the sgml
accordingly
Signed-off-by: Filippo Giunchedi <filippo@esaurito.net>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
christophe.quintard@fr.ibm.com [Thu, 2 Jul 2009 13:42:17 +0000 (15:42 +0200)]
Rewriting the pts section man for lxc.conf
I think this explanation is better.
Signed-off-by: Christophe Quintard <christophe.quintard@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Michel Normand [Wed, 1 Jul 2009 09:58:41 +0000 (11:58 +0200)]
update the lxc-ps man page after previous code change
this is the man page update following the
previous git commit
7cbfc4e4411b6effc6a64fd83a8cb37ffc9c7155
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Wed, 1 Jul 2009 09:58:41 +0000 (11:58 +0200)]
fix compilation warning with malloc
Add missing include stdlib.h
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Michel Normand [Thu, 25 Jun 2009 09:21:56 +0000 (11:21 +0200)]
lxc-execute to return exit code of its child not others
lxc-execute has to return the exit code of it's child not others
as today's code would return the exit code of the last child.
We need to track the first process we launched and store its
exit status when it exits. In order to avoid to detect the exit
of this pid several time if the pids number wrap, we put an extra
flag saying the process group is orhpan.
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Michel Normand [Thu, 25 Jun 2009 09:10:40 +0000 (11:10 +0200)]
replace the lxc-ps bash script by a perl script
Implement the lxc-ps script with perl script.
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Michel Normand [Thu, 25 Jun 2009 09:10:40 +0000 (11:10 +0200)]
another place where readlink to be null terminated
I did this one change by reading the code
but did not tried to run it.
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Michel Normand [Thu, 25 Jun 2009 09:10:40 +0000 (11:10 +0200)]
the lxc_unlink_nsgroup may fail on ppc. V2
the lxc_unlink_nsgroup may fail on ppc
where the stack is not zeroed by default
and because the readlink function do not add trailing null character.
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Michel Normand [Thu, 25 Jun 2009 09:10:39 +0000 (11:10 +0200)]
update the help of lxc-checkpoint and lxc-restart
Update the checkpoint and restart regarding the statefile parameter.
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Matty [Wed, 24 Jun 2009 11:13:18 +0000 (13:13 +0200)]
lxc-fedora fixes
Howdy,
I was playing around with LXC containers this past weekend, and
noticed a couple of issues with the lxc-fedora script:
#1: Line 96 should be ${ROOTFS}/etc/sysconfig/network instead of
${ROOTFS}/sysconfig/network
#2 Line 249 contains a reference to $PKG, which isn't used in the
program. I adjusted the variable to point to the correct package, and
use this in the calls to yumdownloader:
PKG="${DISTRO}-release.noarch.rpm"
.....
yumdownloader --destdir="${CACHE}/partial" "${PKG}"
#3 The $CACHE/partial path is escaped unnecessarily:
RPM="rpm --root \"${CACHE}/partial\""
#4 The program assumes yumdownloader will work, which isn't always the
case. I added an if statement to check the return code:
echo "Downloading distribution release file ${PKG}"
yumdownloader --destdir="${CACHE}/partial" "${PKG}"
RESULT=$?
if [ "${RESULT}" != "0" ]; then
echo "Enable to download the distribution release file"
exit 1
fi
#5 The package name passed to yumdownloader is incorrect:
yumdownloader --destdir="${CACHE}/partial" "${DISTRO}-release.noarch.rpm"
On Fedora 10 and 11, this evaluates to:
fedora-release.noarch.rpm
When we need it to evaluate to:
fedora-{RELEASE_VER}.release.noarch
This is fixed in the PKG variable listed above.
A patch that addresses these issues is attached.
Thanks,
- Ryan
Signed-off-by: Matty <matty91@gmail.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Fri, 12 Jun 2009 14:02:14 +0000 (16:02 +0200)]
unshare the utsname in all the cases
The current code implies we have to define a utsname in order
to unshare it. This problematic in case of system container because
we want them to set their hostname. As the utsname namespace is
a COW, we can safely unshare it in all the cases.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Fri, 12 Jun 2009 14:02:14 +0000 (16:02 +0200)]
fix capability.h compilation problem
The capability.h header is broken on fedora 11.
The workaround is to include <sys/types.h> before <sys/capability.h>.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Wed, 10 Jun 2009 17:04:41 +0000 (19:04 +0200)]
remove pkg-config dependency from lxc
Stupid me, we don't want to add a dependency to an external
tool as the library has to be standalone.
Just let lxc to define a .pc file, so the upper layer will
find the needed informations to use it.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Wed, 10 Jun 2009 17:04:41 +0000 (19:04 +0200)]
remove lxc-config file
Remove this file as it is not used.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Wed, 10 Jun 2009 16:49:16 +0000 (18:49 +0200)]
rename lxc-config to lxc-version
Rename lxc-config to lxc-version in order to avoid the confusion
with what looks like a container configuration tool.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Wed, 10 Jun 2009 16:21:48 +0000 (18:21 +0200)]
replace lxc-version by lxc-config
As we have the correct informations with pkg-config we can
write a script which will collect the informations and we get
rid of the C program.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Wed, 10 Jun 2009 16:21:48 +0000 (18:21 +0200)]
add pkg-config for lxc
Add the pkg-config information for lxc.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Sun, 7 Jun 2009 19:48:46 +0000 (21:48 +0200)]
don't remove the autoconf generated files
Don't clean up the sgml which are generated by configure, otherwise
at the next make, the documentation generation will complain about
missing files.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Sun, 7 Jun 2009 19:48:46 +0000 (21:48 +0200)]
log the container console when it is daemonized and the log is enabled
When we daemonize the container and we specify the log file,
the container will use the log file to write the console output.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Sun, 7 Jun 2009 19:48:46 +0000 (21:48 +0200)]
Make possible to daemonize lxc-start
If needed the container can be launched in background
with a specific option -d.
That will make mute the container, the logs can help
to check what went wrong.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Sun, 7 Jun 2009 19:48:46 +0000 (21:48 +0200)]
save/restore the tty
Save the tty configuration before calling lxc_start and
restore it right after it has been changed.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Filippo Giunchedi [Sun, 7 Jun 2009 19:48:46 +0000 (21:48 +0200)]
Ignore test/ binaries
Hi,
as per subject, this ignores binaries generated in test/
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Filippo Giunchedi [Sun, 7 Jun 2009 19:48:45 +0000 (21:48 +0200)]
test/: update API usage
Hi,
I've been playing with lxc, though with --enable-test the test/ directory
doesn't compile, the following patch ought to fix this.
I've not tested tests throughly but seems straightforward enough.
Update the API usage in test/ as to make tests compile
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Fri, 29 May 2009 12:43:39 +0000 (14:43 +0200)]
Add missing file to the repository
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Michel Normand [Thu, 28 May 2009 13:32:30 +0000 (15:32 +0200)]
change man pages to use a common file for common options
the common options of lxc commands
are now described in one file "common_options.sgml.in"
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Michel Normand [Thu, 28 May 2009 13:32:29 +0000 (15:32 +0200)]
change man pages to use a seealso file for references
the common references to lxc man pages
are now placed in one file "see_also.sgml.in"
Note that the few man pages that refer to man
pages that are not lxc ones have two "See Also" paragraph.
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Michel Normand [Thu, 28 May 2009 13:32:29 +0000 (15:32 +0200)]
avoid two times error msg about invalid state
remove an error message in lxc_wait.c that duplicate
an already existing error message in state.c
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Michel Normand [Thu, 28 May 2009 13:32:29 +0000 (15:32 +0200)]
lxc-wait to check if container already in requested state
Without this patch the lxc_wait may wait forever
if container is already in requested state.
Note that this patch avoids also to be hang if container do not exist yet.
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Michel Normand [Thu, 28 May 2009 13:32:29 +0000 (15:32 +0200)]
add an error message if more than one monitor
the change introduced by commit
31c53c2e1afc6c81ce4aad5ef4cb982cd2fea365
do not allow anymore to have more than one monitor.
The purpose of this patch is to add an error message
when such a condition is identified, eg:
===
lxc-monitor: bind : Address already in use
===
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Thu, 28 May 2009 10:10:51 +0000 (12:10 +0200)]
choose a default network interface name
When no name is specified in the configuration file for an interface,
let the system to choose one nice name like "eth".
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Thu, 28 May 2009 10:10:51 +0000 (12:10 +0200)]
Fix lxc-netstat
The lxc-unshare cli has changed, fix the call to lxc-unshare
in lxc-netstat.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Thu, 28 May 2009 10:10:50 +0000 (12:10 +0200)]
save the config file in the statefile directory
Save the configuration file in the statefile directory so it
can be re-created at restart time.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Thu, 28 May 2009 10:10:50 +0000 (12:10 +0200)]
add a statefile directory parameter
add a statefile directory parameter in order to save some
lxc informations a checkpoint.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Thu, 28 May 2009 10:10:50 +0000 (12:10 +0200)]
copy the configuration file in the conf repo
When creating the container, copy the configuration file to the
configuration tree.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Thu, 28 May 2009 10:10:50 +0000 (12:10 +0200)]
create the container with an empty configuration
Fix the code to not fail when the specified configuration file
is empty.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Thu, 28 May 2009 10:10:50 +0000 (12:10 +0200)]
rename the ns_cgroup with the container name
It is not easy to follow the cgroup name associated with a container,
so right after the container is created, I rename the cgroup which
is the pid of the creator by the container name.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Thu, 28 May 2009 10:10:50 +0000 (12:10 +0200)]
change the checkpoint/restart function api
As the checkpoint/restart is expected to be sequential,
I pass the file descriptor to checkpoint and restart, so
that will be up to the caller to open the file descriptor
which can be a pipe, socket, file, etc ...
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Thu, 28 May 2009 10:10:50 +0000 (12:10 +0200)]
Remove old code to destroy the network
Removed this unused code.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Thu, 28 May 2009 10:10:50 +0000 (12:10 +0200)]
remove checkpoint / restart code
The checkpoint / restart code is too experimental regarding
the current implementation in the kernel.
As there are several implementation and we don't know which
one will be merged upstream, I remove the code and add a few
parameters to checkpoint.
The checkpoint/restart function will be plugins in order to choose
the CR solutions. This approach will allow to switch from one
implementation to another without breaking anything.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Thu, 28 May 2009 10:10:50 +0000 (12:10 +0200)]
make use of the copy file function
Now we have specific function to copy the files, make use of it
and remove the old code.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Thu, 28 May 2009 10:10:50 +0000 (12:10 +0200)]
make a "copy file" function
Create a specific function to copy a file from a location to
another location.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Michel Normand [Mon, 18 May 2009 20:30:39 +0000 (22:30 +0200)]
remove lxc_error_t enum that is now useless
There is no more need of the LXC_ERROR defines
and related lxc_strerror function.
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Michel Normand [Mon, 18 May 2009 20:30:39 +0000 (22:30 +0200)]
remove LXC_ERROR_* usage in src/lxc/conf.c as not required
This is useless because error is already reported by the functions
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Michel Normand [Mon, 18 May 2009 20:27:36 +0000 (22:27 +0200)]
lxc-monitor and lxc-wait to return 255 in case of error
to have same exit code for all lxc commands
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Michel Normand [Mon, 18 May 2009 20:27:36 +0000 (22:27 +0200)]
lxc-cgroup to return 255 in case of error
to have same exit code for all lxc commands
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Michel Normand [Mon, 18 May 2009 20:27:36 +0000 (22:27 +0200)]
lxc-console to return 255 in case of error
to have same exit code for all lxc commands
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Michel Normand [Mon, 18 May 2009 20:27:36 +0000 (22:27 +0200)]
lxc-checkpoint ad lxc-restart to return 255 in case of error
to have same exit code for all lxc commands
Note that the lxc-restart is not yet reporting
the error of restarted application as done with lxc-start.
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Michel Normand [Mon, 18 May 2009 20:27:36 +0000 (22:27 +0200)]
lxc-freeze and lxc-unfreeze to return 255 in case of error
to have same exit code for all lxc commands
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Michel Normand [Mon, 18 May 2009 20:27:35 +0000 (22:27 +0200)]
correct error reporting for lxc_setstate
there was a missing init of local variable
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Michel Normand [Mon, 18 May 2009 20:27:35 +0000 (22:27 +0200)]
lxc-destroy return 255 in case of error
to have same exit code for all lxc commands
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Michel Normand [Mon, 18 May 2009 20:27:35 +0000 (22:27 +0200)]
lxc-create to return 255 in case of error
to have same exit code for all lxc commands
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Michel Normand [Mon, 18 May 2009 20:27:35 +0000 (22:27 +0200)]
lxc-stop to return 255 in case of error
to have same exit code for all lxc commands
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Michel Normand [Mon, 18 May 2009 20:27:35 +0000 (22:27 +0200)]
lxc-execute to report exit code of started application
The exit code of the application as reported by lxc-execute is:
0-126 exit code of the application itself
128+n signal n received by the application
255 lxc error
Note that this is the same type of changes as done
for lxc-start command line.
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Michel Normand [Mon, 18 May 2009 20:27:35 +0000 (22:27 +0200)]
add support of lxc log file to lxc-init
pass to lxc-init the log options given to lxc-execute
(in fact logfile logpriority and quiet)
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Michel Normand [Mon, 18 May 2009 20:27:34 +0000 (22:27 +0200)]
lxc-start to report exit code of started application
The exit code of the application as reported by lxc-start is:
0-126 exit code of the application itself
128+n signal n received by the application
255 lxc error
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Michel Normand [Mon, 18 May 2009 20:11:46 +0000 (22:11 +0200)]
add long options step4
add the long options to the remaining lxc_*.c files
that need changes in struct lxc_arguments.
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Michel Normand [Mon, 18 May 2009 20:11:46 +0000 (22:11 +0200)]
add long options step3
add the long options to remaining lxc_*.c files
that do not impact the struct lxc_arguments
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Michel Normand [Mon, 18 May 2009 20:11:45 +0000 (22:11 +0200)]
add long options step2
add the long options to lxc-start
with a small change in lxc_start proto to avoid compilation warning
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Michel Normand [Mon, 18 May 2009 20:11:45 +0000 (22:11 +0200)]
add long options step1
add the long options to lxc-execute as an exemple
of usage of the new functions added in src/lxc/arguments.*
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Michel Normand [Mon, 18 May 2009 20:11:45 +0000 (22:11 +0200)]
add quiet option
This added quiet option allow to disable
the reporting via stderr of the lxc error messages.
Note that the usage function is still printing in case of error,
but will be removed by later patches
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Michel Normand [Mon, 18 May 2009 20:11:45 +0000 (22:11 +0200)]
in lxc-unshare remove log options
remove the -o and -l log options in src/lxc-unshared.c
because these are useless for such a basic test command.
It is sufficient to report the error to stderr.
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Michel Normand [Sun, 17 May 2009 11:43:51 +0000 (13:43 +0200)]
report error in lxc_get_lock
report error in lxc_get_lock and remove the call to lxc_strerror
that become useless for these errors.
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Michel Normand [Sun, 17 May 2009 11:43:51 +0000 (13:43 +0200)]
create a new lxc_check_lock function
added in src/lock.c to replace call to lxc_get_lock and lxc_put_lock,
when only need to check if container is active or not.
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Michel Normand [Fri, 15 May 2009 08:47:08 +0000 (10:47 +0200)]
add a default stderror log appender
This is adding a stderror log appender that is used as default one.
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Michel Normand [Fri, 15 May 2009 08:43:51 +0000 (10:43 +0200)]
properly handle va_list in log_append functions
the support of multiple appenders need to associate
one va_list per appender.
This is the purpose of this patch to copy the va_list
before to call the appender.
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Thu, 14 May 2009 19:28:27 +0000 (21:28 +0200)]
Replace netlink by abstract unix socket
Instead of messing with the netlink messages, let's
use the abstract unix socket and assume we will have
a single receiver and multiple sender.
With this patch mcr-wait and mcr-monitor are mutually
exclusive... for the moment.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Michel Normand [Thu, 14 May 2009 14:27:29 +0000 (16:27 +0200)]
change lxc_cgroup_set/get functions to return -1
and report error message as soon as detected error in these two functions
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Michel Normand [Thu, 14 May 2009 14:27:28 +0000 (16:27 +0200)]
SYSERROR not to add end of line character
I assume this is a typo error.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Michel Normand [Thu, 14 May 2009 13:52:03 +0000 (15:52 +0200)]
add support of a lxc log file to cli
this is adding -o and -l options to all cli of lxc
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Michel Normand [Thu, 14 May 2009 13:52:03 +0000 (15:52 +0200)]
remove fprintf to stderr and replace by ERROR call when needed
do it in all cli, except:
* the usage functions that will be removed by another patch
* the lxc_init that need more work
* the lxc_priority that is not used anymore
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>