- 24 Feb, 2010 8 commits
-
-
Daniel Lezcano authored
The actual behaviour of the console is messy as: * it relies on a heuristic (tty or not, rootfs or not, etc ...) * the container init stole the tty and we lose the control The following patch: * allocates a tty * maps this tty to the container console * proxy the io from the console to the file specified in the configuration lxc.console=<file> That allows to specify a file, a fifo, a $(tty), and can be extended with an uri like file://mypath, net://1.2.3.4:1234, etc ... That solves the problem with the heuristic and the container does no longer stole our current tty. Note by default, the console output will go to a blackhole if no configuration is specified making the container showing nothing. In order to access the console from the tty, use lxc-start -n foo -s lxc.console=$(tty) I propose the make the container to daemonize by default now. I tried the following: in a shell: touch /var/lib/lxc/foo/console tail --retry -f /var/lib/lxc/foo/console in another shell: lxc-start -n foo -s lxc.console=/var/lib/lxc/foo/console Signed-off-by:
Daniel Lezcano <dlezcano@fr.ibm.com>
-
Daniel Lezcano authored
Use a prefixed enum to avoid conflict later. Signed-off-by:Daniel Lezcano <dlezcano@fr.ibm.com>
-
Daniel Lezcano authored
No need to include the lxc_conf structure definition, a forward declaration is enough. Signed-off-by:Daniel Lezcano <dlezcano@fr.ibm.com>
-
Daniel Lezcano authored
Use the mainloop to manage io of the console. Signed-off-by:Daniel Lezcano <dlezcano@fr.ibm.com>
-
Daniel Lezcano authored
Factor out the console code and encapsulate the code in functions. Signed-off-by:Daniel Lezcano <dlezcano@fr.ibm.com>
-
Daniel Lezcano authored
When there is an empty network namespace, we must not move the network device. Signed-off-by:Daniel Lezcano <dlezcano@fr.ibm.com>
-
Daniel Lezcano authored
Add missing include Signed-off-by:Daniel Lezcano <dlezcano@fr.ibm.com>
-
Daniel Lezcano authored
Do not check CPUSET configuration when SMP is not enabled. Signed-off-by:Daniel Lezcano <dlezcano@fr.ibm.com>
-
- 22 Jan, 2010 4 commits
-
-
Daniel Lezcano authored
Increment to 0.6.5 version. Signed-off-by:Daniel Lezcano <dlezcano@fr.ibm.com>
-
Daniel Lezcano authored
There are several cases where the system can no longer access a mount point or a mount point configuration makes the algorithm bogus. For example, we mount something and then we chroot, the mount information will give an unaccessible path and the container won't be able to start because this mount point will be unaccessible. But if it's the case, then we can just warn and continue running the container. Another case is the path to a mount point is not accessible because there is another mount point on top of it hiding the mount point. So the umount will fail and the container won't start. Easy to reproduce: mkdir -p /tmp/dir1/dir2 mount -t tmpfs tmpfs /tmp/dir1/dir2 mount -t tmpfs tmpfs /tmp/dir1 So can we just ignore the error when unmounting and continue to the list again and again until it shrinks. At the end, we just display the list of the unmounted points. Signed-off-by:Daniel Lezcano <dlezcano@fr.ibm.com>
-
Michel Normand authored
Signed-off-by:
Michel Normand <normand@fr.ibm.com> Signed-off-by:
Daniel Lezcano <dlezcano@fr.ibm.com>
-
Michel Normand authored
the last patch commit 81810dd1 make lxc to not compile anymore on rhel5u1 Signed-off-by:
Michel Normand <normand@fr.ibm.com> Signed-off-by:
Daniel Lezcano <dlezcano@fr.ibm.com>
-
- 21 Jan, 2010 7 commits
-
-
Daniel Lezcano authored
Signed-off-by:Daniel Lezcano <dlezcano@fr.ibm.com>
-
Daniel Lezcano authored
Hello everyone! I've written a patch which adds a new config keyword 'lxc.cap.drop'. This keyword allows to specify capabilities which are dropped before executing the container binary. Example: lxc.cap.drop = sys_chroot lxc.cap.drop = mknod lxc.cap.drop = sys_module or specify in a single line: lxc.cap.drop = sys_chroot mknod sys_module Reworked-by:
Daniel Lezcano <daniel.lezcano@free.fr> Signed-off-by:
Daniel Lezcano <dlezcano@fr.ibm.com> Signed-off-by:
Michael Holzt <lxc@my.fqdn.org> Signed-off-by:
Daniel Lezcano <dlezcano@fr.ibm.com>
-
Daniel Lezcano authored
A mindless change. Signed-off-by:Daniel Lezcano <dlezcano@fr.ibm.com>
-
Michel Normand authored
Signed-off-by:
Michel Normand <normand@fr.ibm.com> Signed-off-by:
Daniel Lezcano <dlezcano@fr.ibm.com>
-
Michel Normand authored
Signed-off-by:
Michel Normand <normand@fr.ibm.com> Signed-off-by:
Daniel Lezcano <dlezcano@fr.ibm.com>
-
Michel Normand authored
Signed-off-by:
Michel Normand <normand@fr.ibm.com> Signed-off-by:
Daniel Lezcano <dlezcano@fr.ibm.com>
-
Michel Normand authored
Signed-off-by:
Cedric Le Goater <clg@fr.ibm.com> Signed-off-by:
Daniel Lezcano <dlezcano@fr.ibm.com>
-
- 20 Jan, 2010 7 commits
-
-
Michel Normand authored
warning with git am, white before tab correction Signed-off-by:
Michel Normand <normand@fr.ibm.com> Signed-off-by:
Daniel Lezcano <dlezcano@fr.ibm.com>
-
Greg Kurz authored
The handler argument to lxc_fini() is never null. Signed-off-by:
Greg Kurz <gkurz@fr.ibm.com> Signed-off-by:
Cedric Le Goater <clg@fr.ibm.com> Signed-off-by:
Daniel Lezcano <dlezcano@fr.ibm.com>
-
Greg Kurz authored
sv[0] has already been closed when reaching out_abort label. Signed-off-by:
Greg Kurz <gkurz@fr.ibm.com> Signed-off-by:
Cedric Le Goater <clg@fr.ibm.com> Signed-off-by:
Daniel Lezcano <dlezcano@fr.ibm.com>
-
Michel Normand authored
Signed-off-by:
Michel Normand <normand@fr.ibm.com> Signed-off-by:
Daniel Lezcano <dlezcano@fr.ibm.com>
-
Clement Calmels authored
Signed-off-by:
Clement Calmels <clement.calmels@fr.ibm.com> Signed-off-by:
Cedric Le Goater <clg@fr.ibm.com> Signed-off-by:
Daniel Lezcano <dlezcano@fr.ibm.com>
-
Greg Kurz authored
It makes sense to use goto when there's some rollback work to be done. And it's nice for code clarity to add an explicit suffix to goto labels. Signed-off-by:
Greg Kurz <gkurz@fr.ibm.com> Signed-off-by:
Cedric Le Goater <clg@fr.ibm.com> Signed-off-by:
Daniel Lezcano <dlezcano@fr.ibm.com>
-
Michel Normand authored
Signed-off-by:
Michel Normand <normand@fr.ibm.com> Signed-off-by:
Daniel Lezcano <dlezcano@fr.ibm.com>
-
- 18 Jan, 2010 4 commits
-
-
Taisuke Yamada authored
I noticed lxc-console uses '^a' as command-mode prefix to escape out of console session, so created a patch to make it configurable. With this, you can do lxc-console -n foo -e ^t and exit the session with 'Ctrl+t q'. For emacs-binding addicts (like me), it's always nice to let shell handle '^a' as 'beginning-of-line' command... Signed-off-by:
Taisuke Yamada <tai@rakugaki.org> Signed-off-by:
Daniel Lezcano <dlezcano@fr.ibm.com>
-
Clement Calmels authored
Signed-off-by:
Clement Calmels <clement.calmels@fr.ibm.com> Signed-off-by:
Daniel Lezcano <dlezcano@fr.ibm.com>
-
Clement Calmels authored
The getline function allocate the needed memory. Fix buffer can lead to 'hard to find' bug. I don't test the pivot_root part but the other parts are ok. Signed-off-by:
Clement Calmels <clement.calmels@fr.ibm.com> Signed-off-by:
Daniel Lezcano <dlezcano@fr.ibm.com>
-
Clement Calmels authored
Correct the way the struct dirent **namelist structure is freed. Signed-off-by:
Clement Calmels <clement.calmels@fr.ibm.com> Signed-off-by:
Daniel Lezcano <dlezcano@fr.ibm.com>
-
- 14 Jan, 2010 5 commits
-
-
Daniel Lezcano authored
lxc_config_define_load should an int Signed-off-by:Daniel Lezcano <dlezcano@fr.ibm.com>
-
Cedric Le Goater authored
Signed-off-by:
Cedric Le Goater <clg@fr.ibm.com> Signed-off-by:
Daniel Lezcano <dlezcano@fr.ibm.com>
-
Cedric Le Goater authored
Signed-off-by:
Cedric Le Goater <clg@fr.ibm.com> Signed-off-by:
Daniel Lezcano <dlezcano@fr.ibm.com>
-
Cedric Le Goater authored
Signed-off-by:
Cedric Le Goater <clg@fr.ibm.com> Signed-off-by:
Daniel Lezcano <dlezcano@fr.ibm.com>
-
Cedric Le Goater authored
lxc_config_define_add() and lxc_config_define_load() define the interface to load a list of KEY=VAL buffers in the configuration Signed-off-by:
Cedric Le Goater <clg@fr.ibm.com> Signed-off-by:
Daniel Lezcano <dlezcano@fr.ibm.com>
-
- 13 Jan, 2010 5 commits
-
-
Daniel Lezcano authored
Signed-off-by:Daniel Lezcano <dlezcano@fr.ibm.com>
-
Cedric Le Goater authored
lxc_config_readline() will be used to parse configuration variable assigned from the command line with --define Signed-off-by:
Cedric Le Goater <clg@fr.ibm.com> Signed-off-by:
Daniel Lezcano <dlezcano@fr.ibm.com>
-
Clement Calmels authored
Just use a list instead of array for dynamically allocated stuff. It's more appropriated. Signed-off-by:
Clement Calmels <clement.calmels@fr.ibm.com> Signed-off-by:
Daniel Lezcano <dlezcano@fr.ibm.com>
-
Clement Calmels authored
A simple test program to show up the issue: -8<--- #include <stdio.h> #include <unistd.h> #include "mainloop.h" struct lxc_epoll_descr loop; int cb1(int fd, void *data, struct lxc_epoll_descr *descr) { fprintf(stderr, "cb1\n"); return 1; } int cb2(int fd, void *data, struct lxc_epoll_descr *descr) { fprintf(stderr, "cb2\n"); return 1; } int main(int argc, char *argv[]) { int ret; int fds[2]; ret = pipe(fds); if (ret) { perror("pipe:"); return -1; } ret = lxc_mainloop_open(&loop); if (ret) { fprintf(stderr, "lxc_mainloop_open: %d\n", ret); return -1; } ret = lxc_mainloop_add_handler(&loop, fds[1], cb1, NULL); if (ret) { fprintf(stderr, "lxc_mainloop_add_handler(fds[1]): %d\n", ret); return -1; } ret = lxc_mainloop_add_handler(&loop, fds[0], cb2, NULL); if (ret) { fprintf(stderr, "lxc_mainloop_add_handler(fds[0]): %d\n", ret); return -1; } write(fds[1], &ret, sizeof(ret)); ret = lxc_mainloop(&loop); if (ret) { fprintf(stderr, "lxc_mainloop: %d\n", ret); return -1; } ret = lxc_mainloop_close(&loop); if (ret) { fprintf(stderr, "lxc_mainloop_close: %d\n", ret); return -1; } return 0; } Compile and run: $ gcc test.c -o test -I ./src/lxc/ ./src/lxc/liblxc_so-mainloop.o && ./test cb2 -
Clement Calmels authored
Let's take an example: fd = open(..) /* fd = 3 for example */ lxc_mainloop_add_handler(descr, fd, cb1, data1) fails. the program take care of the error, it closes the fd Later, reopen a fd (get 3 for again) lxc_mainloop_add_handler(desc, fd, cb2, data2) is ok. When something happen on fd, cb1 with data1 will be called instead of cb2 with data2, because descr->ev contains 2 entries for fd == 3. Signed-off-by:
Clement Calmels <clement.calmels@fr.ibm.com> Signed-off-by:
Daniel Lezcano <dlezcano@fr.ibm.com>
-