Commit Graph

59 Commits

Author SHA1 Message Date
Jian Xiao
307cf2a670 remove redundent LXC_TTY_HANDLER
All the signals (except fatal ones) are redirected to signalfd at lxc_init,
so the LXC_TTY_HANDLERs are redundant. This patch removes them.

Signed-off-by: Jian Xiao <jian@linux.vnet.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2012-02-23 09:57:13 +01:00
Daniel Lezcano
1b09f2c057 fix pivot_root temporary directory
First of all, when trying to start a container in a read-only root
lxc-start complains:
  lxc-start: Read-only file system - can't make temporary mountpoint

This is in conf.c:setup_rootfs_pivot_root() function.  That function
uses optional parameter "lxc.pivotdir", or creates (and later removes)
a temporary directory for pivot_root.  Obviously there's no way to
create a directory in a read-only filesystem.

But lxc.pivotdir does not work either. In the function mentioned above
it is used with leading dot (eg. if I specify "lxc.pivotdir=pivot" in
the config file the pivot_root() syscall will be made to ".pivot" with
leading dot, not to "pivot"), but later on it is used without that dot,
and fails:

  lxc-start: No such file or directory - failed to open /pivot/proc/mounts
  lxc-start: No such file or directory - failed to read or parse mount list '/pivot/proc/mounts'
  lxc-start: failed to pivot_root to '/stage/t'

(that's with "lxc.pivotdir = pivot" in the config file).  After symlinking
pivot to .pivot it still fails:

  lxc-start: Device or resource busy - could not unmount old rootfs
  lxc-start: failed to pivot_root to '/stage/t'

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Reported-by: Michael Tokarev <mjt@tls.msk.ru>
2010-05-10 11:50:09 +02:00
Cedric Le Goater
80090207de lxc: forbid open fds upon startup
This patch modifies the startup of a container to forbid opened
fds, unless these are stdios.

Signed-off-by: Cedric Le Goater <clg@fr.ibm.com>
2010-03-22 11:08:34 +01:00
Jamal Hadi Salim
9ddaf3bf1c Add utility u16 get/put
Add utility functions to parse a u16 and put a u16 on a
netlink message
    
Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
Acked-by: Daniel Lezcano <daniel.lezcano@free.fr>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-12-15 10:14:26 +01:00
Michel Normand
6e4bb2e01f lxc: move setup_fs to utils.c
This is not required immidiately but may be used by other init.

Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-11-17 22:57:46 +01:00
Daniel Lezcano
af79587587 fix closed fd when they are inherited
This patch fix a problem with the commit d983b93c3a
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>
2009-07-20 17:57:31 +02:00
Michel Normand
d983b93c3a 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>
2009-07-15 23:48:22 +02:00
Daniel Lezcano
e3642c43e6 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>
2009-05-28 12:10:50 +02:00
dlezcano
0ad19a3fc3 Joined liblxc and lxc directory 2008-09-04 07:57:50 +00:00