]> git.proxmox.com Git - mirror_lxc.git/log
mirror_lxc.git
14 years agoremove unused cr_plugin_columbia.c
Michel Normand [Thu, 19 Nov 2009 14:06:02 +0000 (15:06 +0100)]
remove unused cr_plugin_columbia.c

Remove checkpoint / restart dead code.

Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agolxc_init better error reporting
Michel Normand [Thu, 19 Nov 2009 14:06:02 +0000 (15:06 +0100)]
lxc_init better error reporting

Display the 'rcfile' value on error

Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agochange network_netdev function parameter
Daniel Lezcano [Thu, 19 Nov 2009 14:06:02 +0000 (15:06 +0100)]
change network_netdev function parameter

A mindless change to encapsulate a little more the function.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agofactor out common config evaluating code
Michael Tokarev [Thu, 19 Nov 2009 14:06:02 +0000 (15:06 +0100)]
factor out common config evaluating code

in confile.c we currently have a ton of functions each doing
the same thing.  Clean them up by providing common routines
to do the main work.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agorename struct lxc_netdev fields to match reality
Michael Tokarev [Thu, 19 Nov 2009 14:06:02 +0000 (15:06 +0100)]
rename struct lxc_netdev fields to match reality

struct lxc_netdev is used to hold information from cnfig file
about a network device/configuration.  Make the fields of this
structure to be named similarily with the config file keywords,
namely:
 s/ifname/link/ - host-side link for the device (bridge or eth0)
 s/newname/name/ - container-side ifname
It is insane to have completely different names in config file
and in structure/variable names :)

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agoupdate the man pages
Daniel Lezcano [Thu, 19 Nov 2009 14:06:02 +0000 (15:06 +0100)]
update the man pages

Update the man pages regarding the modifications around the
configuration option, volatile containers and new configuration
file format.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agoexport set_state function
Michel Normand [Tue, 17 Nov 2009 21:57:46 +0000 (22:57 +0100)]
export set_state function

This function will be needed for the restart function.

Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agoadd capabilities for lxc-checkpoint
Michel Normand [Tue, 17 Nov 2009 21:57:46 +0000 (22:57 +0100)]
add capabilities for lxc-checkpoint

add capabilities for lxc-checkpoint

Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agolxc: move setup_fs to utils.c
Michel Normand [Tue, 17 Nov 2009 21:57:46 +0000 (22:57 +0100)]
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>
14 years agofix container find the previously created configuration
Daniel Lezcano [Tue, 17 Nov 2009 21:57:46 +0000 (22:57 +0100)]
fix container find the previously created configuration

The command specifies a configuration file => use it
The command does not specify a configuration but the container
was created before, use the configuration.
The command does not specify a configuration and the container
was not created before, use default.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agolxc-netstat should use @LXCPATH@ for lxcpath=
Andrian Nord [Tue, 17 Nov 2009 09:56:24 +0000 (10:56 +0100)]
lxc-netstat should use @LXCPATH@ for lxcpath=

Typo ;)

Signed-off-by: Andrian Nord <NightNord@gmail.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agobatched reads for lxc_console
Michael Tokarev [Tue, 17 Nov 2009 09:56:24 +0000 (10:56 +0100)]
batched reads for lxc_console

Instead of doing I/O one-byte-at-a-time in lxc_console,
which is slow, let's do it in batches.  Only for output
(from container to the host system), since input is most
likely one-byte-at-a-time anyway (from a keyboard).

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agohost consoles/ttys in containers
Michael Tokarev [Tue, 17 Nov 2009 09:56:24 +0000 (10:56 +0100)]
host consoles/ttys in containers

I noticed that container's consoles aren't quite useable
(be it lxc-console or lxc-start with getty bound to /dev/console).
The main problem is a complete lack of window resizing support:
when I resize an xterm window with lxc-start or lxc-console, the
"guest" does not know about that and continues to think that the
terminal is 80x25 still.

Is it just a lack of functionality (missing implementation) or
something problematic?

Ok, the attached patch fixes this.

It moves the 'master' variable out of main function so it's
accessible from the signal handler, sets up SIGWINCH handler
to call a (newly created) winsz() function that gets the
current tty size using TIOCGWINSZ ioctl and if that works,
sets up the pty size using TIOCSWINSZ.  That same function
is called at the start as well, when setting up the signal
handler.

Signed-off-By: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-By: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agoChoose configuration directory
Andrian Nord [Tue, 17 Nov 2009 09:56:23 +0000 (10:56 +0100)]
Choose configuration directory

Maybe it will be more logical to keep configs into /etc/lxc/?

Or, maybe, just use --with-config-path=/some/path switch into configure,
which could be overridden as user wants to? Something like this one (in
assumption, that this is up to user to create corresponding directory):

Signed-off-by: Andrian Nord <NightNord@gmail.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agocleanup <lxc/lxc.h>
Cedric Le Goater [Tue, 17 Nov 2009 09:56:23 +0000 (10:56 +0100)]
cleanup <lxc/lxc.h>

<lxc/lxc.h>  should only include what is needed. This patch removes
all useless headers from lxc.h and fixed other .c files.

Signed-off-by: Cedric Le Goater <clg@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agotypo in 488624016575d092d56211347b2bbe8367cd339a (V2)
Michel Normand [Fri, 13 Nov 2009 21:55:23 +0000 (22:55 +0100)]
typo in 488624016575d092d56211347b2bbe8367cd339a (V2)

without this correction, unable to create a container with a configuration file.
This is a side effect of commit 488624016575d092d56211347b2bbe8367cd339a

Signed-off-by: Michel Normand <michel.mno@free.fr>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agoFix lxc-netstat script
Daniel Lezcano [Fri, 13 Nov 2009 10:48:29 +0000 (11:48 +0100)]
Fix lxc-netstat script

Recent changes around the configuration tree broke the current
implementation of the lxc-netstat.

Instead of retrieving the init_pid in the /var/lxc/<name>/...,
pick one in the cgroup tasks list.

There is still a restriction with this command making impossible
to run it as non-root, any idea is welcome :(

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agoQ: general lxc architecture
Andrian Nord [Fri, 13 Nov 2009 10:48:29 +0000 (11:48 +0100)]
Q: general lxc architecture

Patch moves etc/* contents into doc/examples/ and adds
--disable-examples configure switch which may be used not to install
examples. Default is to install them into ${docdir}/examples (commonly:
/usr/share/doc/lxc/examples)

Signed-off-by: Andrian Nord <NightNord@gmail.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agolxc lxc-sshd using new lxc.mount.entry keyword
Michel Normand [Fri, 13 Nov 2009 10:48:29 +0000 (11:48 +0100)]
lxc lxc-sshd using new lxc.mount.entry keyword

Signed-off-by: Michel Normand <michel_mno@laposte.net>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agolxc: remove lxc.mount setting in lxc-fedora script
Michel Normand [Fri, 13 Nov 2009 10:48:29 +0000 (11:48 +0100)]
lxc: remove lxc.mount setting in lxc-fedora script

This script do not use extract fstab (as done by lxc-debian)
so there is no reason to set the lxc.mount key in config file.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Signed-off-by: Michel Normand <michel_mno@laposte.net>
14 years agolxc-debian using new lxc.mount.entry keyword
Michel Normand [Fri, 13 Nov 2009 10:48:29 +0000 (11:48 +0100)]
lxc-debian using new lxc.mount.entry keyword

Fix script to not add a fstab file.

Signed-off-by: Michel Normand <michel_mno@laposte.net>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agolxc: add a new lxc.mount.entry keyword
Michel Normand [Fri, 13 Nov 2009 10:48:29 +0000 (11:48 +0100)]
lxc: add a new lxc.mount.entry keyword

The purpose of this new keyword is to save in main config file
all the lines of a provided fstab file.
This will ultimately replace the the lxc.mount keyword
when lxc scripts will use the new keyword.

Warning: I did not validated this patch
in all conditions of provided malformed input string.

Signed-off-by: Michel Normand <michel_mno@laposte.net>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agostop config reading if cgroup setting failed
Michel Normand [Fri, 13 Nov 2009 10:48:29 +0000 (11:48 +0100)]
stop config reading if cgroup setting failed

in today's code lxc-start to not stop if setup_cgroup is detecting an error

Signed-off-by: Michel Normand <michel_mno@laposte.net>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agolxc-debian to not use empty mount table
Michel Normand [Fri, 13 Nov 2009 10:48:29 +0000 (11:48 +0100)]
lxc-debian to not use empty mount table

lxc should not save in config generated file the name of an
empty file if no additionnal mount point specified by user.

Signed-off-by: Michel Normand <michel_mno@laposte.net>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agoReplace create/destroy by a script
Daniel Lezcano [Fri, 13 Nov 2009 10:48:29 +0000 (11:48 +0100)]
Replace create/destroy by a script

The simplification of the container configuration makes
pointless to have so much complexity in the container creation.
Let's remove that and replace by some scripts.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agoAllows a container to run without previous creation
Daniel Lezcaon [Fri, 13 Nov 2009 10:48:29 +0000 (11:48 +0100)]
Allows a container to run without previous creation

When a container was created, its configuration is used.
When a container was not created, the configuration specified in
the command line is used, if not configuration file is used,
default values are used.

That allows to create 'volatile' container, like tmp files.
It is useful for example to spawn different container with the
same generic configuration file. That let the user to have its own
repository of configuration files.

And, more important, that fix temporary created container with
lxc-execute to be not deleted when the host crash or the command
is killed.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agoliblxc: Fix compile failure
Dhaval Giani [Fri, 13 Nov 2009 10:48:29 +0000 (11:48 +0100)]
liblxc: Fix compile failure

Fix compile failure

commit 884866b3c305f1edd74c9ea7f082d009a86f3fd5 introduces a compile
failure,

make[3]: *** No rule to make target `lock.c', needed by `liblxc_so-lock.o'.  Stop.
make[3]: Leaving directory `/home/dhaval/work/lxc/lxc/src/lxc'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/dhaval/work/lxc/lxc/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/dhaval/work/lxc/lxc/src'
make: *** [all-recursive] Error 1

Remove those entries from the Makefile

Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agoFix abstract af_unix socket name
Daniel Lezcano [Thu, 12 Nov 2009 13:40:14 +0000 (14:40 +0100)]
Fix abstract af_unix socket name

Fix a typo making the abstract af_unix socket name to be wrong.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agoRemove the usage of a lock file
Daniel Lezcano [Thu, 12 Nov 2009 13:40:14 +0000 (14:40 +0100)]
Remove the usage of a lock file

The lock is no longer needed as the mutual exclusion and
'is running' check is done via the af_unix command socket.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agoexport log function so it can be used by library user
Cedric Le Goater [Thu, 12 Nov 2009 13:40:14 +0000 (14:40 +0100)]
export log function so it can be used by library user

The log api may be used by an external component which needs to
access these functions.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agoRemove an unnecessary entry in the spec file
Ryousei Takano [Wed, 11 Nov 2009 20:33:44 +0000 (21:33 +0100)]
Remove an unnecessary entry in the spec file

Hi Daniel and all,

The rpmbuild command fails due to an unnecessary *.a entry in the %file list.
This patch removes it from the lxc.spec file.

Signed-off-by: Ryousei Takano <takano-ryousei@aist.go.jp>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agoipv6 interfaces added with /0 prefix
Andrian Nord [Mon, 9 Nov 2009 09:43:03 +0000 (10:43 +0100)]
ipv6 interfaces added with /0 prefix

Greetings, I've found a small typo into src/lxc/conf.c that leads to
nulled prefix for ipv6 addresses.

Signed-off-by: Andrian Nord <NightNord@gmail.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agolxc: lxc version to reflect string in AC_INIT (V2)
Michel Normand [Wed, 4 Nov 2009 14:14:30 +0000 (15:14 +0100)]
lxc: lxc version to reflect string in AC_INIT (V2)

I changed the code to have lxc version to reflect the
string set in AC_INIT of configure.ac
rather than to report only the 3 first digits

update: use PACKAGE_VERSION in place of VERSION

Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agoconfigure.ac - allow user to switch off/on documentation generation
Andrian Nord [Wed, 4 Nov 2009 13:03:44 +0000 (14:03 +0100)]
configure.ac - allow user to switch off/on documentation generation

Andrian Nord <NightNord@gmail.com>:
>> > > As documentation requires docbook2man to be installed, which is not,
>> > > otherwise, required for proper LXC work or compilation process, it
>> > > might be usefull to be able to switch it off.

Michel Normand <normand@fr.ibm.com>:
> > For me, it is Ok to add a --enable/disable/-doc,
> > but not make configure to fail if no option specified
> > and no docbook2man package.
> >
> > For me it should be optionnal.
> > I like the current behaviour where configure is running without option
> > and is enabling/disabling by itself the doc building.
> > Could you send a new patch with this idea ?

Andrian Nord <NightNord@gmail.com>:
Of course. You mean, that you what default behaviour to remain
auto-detection? That is:
--enable-doc: require docbook2man or fail, generate mans
--enable-doc=auto, or not specified (default): check for docbook2man,
generate mans if found, silently ignore if not found (I suppose
diagnostic message is redundant, as information already contains into
./configure --help)
--disable-doc: never check for docbook2man and don't gen mans

Here comes a patch what do this, as far as I see
(I'm sorry for violating post-rules in previous mail, now I'll do all
right, I hope. Should I attach patch anyway, as it might be usefull
for applying?)

Signed-off-by: Andrian Nord <NightNord@gmail.com>
Acked-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agolxc /cgroup/name/ not removed at container end
Michel Normand [Tue, 3 Nov 2009 10:40:42 +0000 (11:40 +0100)]
lxc /cgroup/name/ not removed at container end

this is a side effect of my previous patch
that removed the LXCPATH/name/nsgroup file.
9f44c57836626d8eb16c7bba4a5f5d88db74df01

Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agofix compilation error when buildir differs from srcdir
Daniel Lezcano [Fri, 23 Oct 2009 09:15:27 +0000 (11:15 +0200)]
fix compilation error when buildir differs from srcdir

Fix the include path for compiling and clean the Makefile.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Reported-by: Michel Normand <normand@fr.ibm.com>
14 years agolxc: kill libtool
Cedric Le Goater [Thu, 22 Oct 2009 13:33:40 +0000 (15:33 +0200)]
lxc: kill libtool

This is useless in a Linux only environment. The .so version is
the version of the package.

Signed-off-by: Cedric Le Goater <clg@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agouse config.h to define the lxcpath and co
Daniel Lezcano [Thu, 22 Oct 2009 13:33:40 +0000 (15:33 +0200)]
use config.h to define the lxcpath and co

Instead of passing the LXCPATH definition in the compiler
command line, use configure.ac to define the value in the config.h
file and include this file where it is needed.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agoremove test directory
Daniel Lezcano [Thu, 22 Oct 2009 13:33:40 +0000 (15:33 +0200)]
remove test directory

These tests are not relevant now. It would be better to write
some real test cases with some script using the lxc cli in order
to check non regression.
I remove these annoying tests I have to port each time a function
prototype is changed.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agomount /dev/mqueue
Daniel Lezcano [Thu, 15 Oct 2009 12:17:14 +0000 (14:17 +0200)]
mount /dev/mqueue

Mount always /dev/mqueue with lxc_init.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agoclean up and factor out some code
Daniel Lezcano [Mon, 12 Oct 2009 20:02:06 +0000 (22:02 +0200)]
clean up and factor out some code

Factor out some code and fix a memory corruption when
dupping the arguments.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agoFix network prefix
Daniel Lezcano [Mon, 12 Oct 2009 20:02:06 +0000 (22:02 +0200)]
Fix network prefix

Fix the missing network prefix. When no network prefix is specified,
the prefix is computed from the network class specified.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agofix compilation error for tests
Daniel Lezcano [Mon, 12 Oct 2009 20:02:06 +0000 (22:02 +0200)]
fix compilation error for tests

Fix test program compilation errors.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agoremove configure dead code
Daniel Lezcano [Mon, 12 Oct 2009 20:02:06 +0000 (22:02 +0200)]
remove configure dead code

Remove the old configuration remaining code.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agofix tty creation using confdir
Daniel Lezcano [Fri, 9 Oct 2009 09:38:39 +0000 (11:38 +0200)]
fix tty creation using confdir

tty_create uses the old conf directory, fixing this.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agofix netdev structure vs network structure
Daniel Lezcano [Fri, 9 Oct 2009 09:38:39 +0000 (11:38 +0200)]
fix netdev structure vs network structure

The netdev vs network structure is not well defined. Fix that.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agoFactor out some network code
Daniel Lezcano [Fri, 9 Oct 2009 09:38:39 +0000 (11:38 +0200)]
Factor out some network code

We can factor out the "ip addr add"

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agoUse the configuration structure for the network
Daniel Lezcano [Fri, 9 Oct 2009 09:38:39 +0000 (11:38 +0200)]
Use the configuration structure for the network

We don't want to use anymore the configuration directory,
let's use the configuration structure.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agoMove configuration info to the structure
Daniel Lezcano [Fri, 9 Oct 2009 09:38:39 +0000 (11:38 +0200)]
Move configuration info to the structure

Move configuration informations from the handler structure to
the configuration structure.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agoMove the configuration file to the start function
Daniel Lezcano [Fri, 9 Oct 2009 09:38:39 +0000 (11:38 +0200)]
Move the configuration file to the start function

We want to store more information in the configuration structure,
especially the ttys.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agouse the configuration structure for the cgroup
Daniel Lezcano [Fri, 9 Oct 2009 09:38:39 +0000 (11:38 +0200)]
use the configuration structure for the cgroup

Do not use the directory configuration

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agoremove the LXCPATH/<name>/nsgroup file
Michel Normand [Fri, 9 Oct 2009 09:38:39 +0000 (11:38 +0200)]
remove the LXCPATH/<name>/nsgroup file

There is no more need of this file so remove it.

Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agouse the new nsgroup_path_get function in freezer.c
Michel Normand [Fri, 9 Oct 2009 09:38:39 +0000 (11:38 +0200)]
use the new nsgroup_path_get function in freezer.c

to avoid to use the LXCPATH/<name>/nsgroup

Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agonew lxc_cgroup_path_get function
Michel Normand [Fri, 9 Oct 2009 09:38:39 +0000 (11:38 +0200)]
new lxc_cgroup_path_get function

remove the usage of LXCPATH/<name>/nsgroup
in get/set function.

Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agoplace nscgroup path in lxc_handler
Michel Normand [Fri, 9 Oct 2009 09:38:39 +0000 (11:38 +0200)]
place nscgroup path in lxc_handler

this also avoid to call two times get_cgroup_mount

Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agouse the configuration structure for the tty
Daniel Lezcano [Fri, 9 Oct 2009 09:38:39 +0000 (11:38 +0200)]
use the configuration structure for the tty

Do not use the directory configuration

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agouse configuration structure for the mount points
Daniel Lezcano [Fri, 9 Oct 2009 09:38:39 +0000 (11:38 +0200)]
use configuration structure for the mount points

Do not use the directory configuration for the mount points.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agoUse the configuration structure for pts
Daniel Lezcano [Fri, 9 Oct 2009 09:38:38 +0000 (11:38 +0200)]
Use the configuration structure for pts

Avoid to use the directory structure.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agouse the configuration structure to setup the utsname
Daniel Lezcano [Fri, 9 Oct 2009 09:38:38 +0000 (11:38 +0200)]
use the configuration structure to setup the utsname

Use the configuration structure, not the directory configuration

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agouse the configuration structure for setting up the rootfs
Daniel Lezcano [Fri, 9 Oct 2009 09:38:38 +0000 (11:38 +0200)]
use the configuration structure for setting up the rootfs

use the configuration structure for setting up the rootfs

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agouse the configuration to check if a resource is enabled
Daniel Lezcano [Fri, 9 Oct 2009 09:38:38 +0000 (11:38 +0200)]
use the configuration to check if a resource is enabled

Remove the usage of the directory config for the setup and use the
configuration structure instead.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agoRead the config file at restart
Daniel Lezcano [Fri, 9 Oct 2009 09:38:38 +0000 (11:38 +0200)]
Read the config file at restart

This patch makes the configuration to read the configuration
file in order to pass the configuration to the different functions.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agomake container to die when parent dies
Daniel Lezcano [Wed, 7 Oct 2009 14:06:09 +0000 (16:06 +0200)]
make container to die when parent dies

When the parent of the first process dies, the container stays there
making very difficuly to track it and to kill. We have to use the
lxc-ps --lxc and kill the processes, hoping we kill the init process
of the container. That's not a big deal until we have thousand of
processes in the container :)

We want to keep the parent of the container init always there, this
process is responsible to manage the container, provide tty, notify
the container changing states and ensure self exclusion (eg. avoid
to launch several containers with the same name).

If this process dies, we consider that as a fatal error and we make
the child process to die too. This patch will just add the prctl to
to send a SIGKILL to the container init process when its parent exits
For the point of view of the pid namespace, when the init process dies
all the processes of the namespace are killed too.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agoSimplify the mainloop
Daniel Lezcano [Wed, 7 Oct 2009 14:06:09 +0000 (16:06 +0200)]
Simplify the mainloop

The number of fds passed to epoll is just a hint for the kernel.
In our case, we know this is often 2, let's remove this parameter
from lxc_mainloop_open and cleanup the code around the caller of
this function.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agoformat and fix small typos
Daniel Lezcano [Wed, 7 Oct 2009 14:06:09 +0000 (16:06 +0200)]
format and fix small typos

Indent and make the code cleaner.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agoremove dead code in monitor.c
Michel Normand [Wed, 7 Oct 2009 14:06:09 +0000 (16:06 +0200)]
remove dead code in monitor.c

This code is not used in lxc.

Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agoremove src/lxc/lxc_priority.c
Michel Normand [Wed, 7 Oct 2009 14:06:09 +0000 (16:06 +0200)]
remove src/lxc/lxc_priority.c

this was useless since old commit
576f946d784dbe7bf9008565647bde81ed064dc2
that intoduced the cgroup support.

Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agoreturns a specific info when we have ECONNREFUSED
Daniel Lezcano [Wed, 7 Oct 2009 14:06:09 +0000 (16:06 +0200)]
returns a specific info when we have ECONNREFUSED

When a command can not be send because the connection is refused,
that means the container is stopped. Let's report this specific
case instead of raising an error.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Signed-off-by: Michel Normand <normand@fr.ibm.com>
14 years agoremove dead state code
Daniel Lezcano [Wed, 7 Oct 2009 14:06:09 +0000 (16:06 +0200)]
remove dead state code

Remove old dead code.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agofix the abstract unix socket name
Daniel Lezcano [Wed, 7 Oct 2009 14:06:09 +0000 (16:06 +0200)]
fix the abstract unix socket name

Let's use a more sexy name

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agohandle the state command
Daniel Lezcano [Wed, 7 Oct 2009 14:06:09 +0000 (16:06 +0200)]
handle the state command

handle the state command.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agoreturns the state of the container with the af_unix socket
Daniel Lezcano [Wed, 7 Oct 2009 14:06:09 +0000 (16:06 +0200)]
returns the state of the container with the af_unix socket

Like the pid, let's store the state in the handler and modify it
at runtime. Return the value of state with a specific command.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agodo some cleanup around the old init pid file
Daniel Lezcano [Wed, 7 Oct 2009 14:06:08 +0000 (16:06 +0200)]
do some cleanup around the old init pid file

This file is no longer used, let's remove it.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agoremove dead stop code
Daniel Lezcano [Wed, 7 Oct 2009 14:06:08 +0000 (16:06 +0200)]
remove dead stop code

Remove old dead code.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agohandle the stop command
Daniel Lezcano [Wed, 7 Oct 2009 14:06:08 +0000 (16:06 +0200)]
handle the stop command

Handle the stop command. The stop command waits for the peer to
disconnect, that means the peer has exited, so it is safe to
return to the user control. By this way, we ensure a stop command
followed by a start or a destroy won't fail with a race condition
because the start command is not yet finised.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Signed-off-by: Michel Normand <normand@fr.ibm.com>
14 years agocheck permissions when receiving command
Michel Normand [Wed, 7 Oct 2009 14:06:08 +0000 (16:06 +0200)]
check permissions when receiving command

report to command requester the errno if credential failure,
rather than to only close the connection.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Signed-off-by: Michel Normand <normand@fr.ibm.com>
14 years agorepackage previous code to new commands.c
Michel Normand [Wed, 7 Oct 2009 14:06:08 +0000 (16:06 +0200)]
repackage previous code to new commands.c

move some code of start.c to new commands.c and to console.c

Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agoadd an additionnal abstract socket to prepare for more commands
Michel Normand [Wed, 7 Oct 2009 14:06:08 +0000 (16:06 +0200)]
add an additionnal abstract socket to prepare for more commands

Replace the current tty service socket by a general command service
socket and plug for the moment only the existing tty service.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Signed-off-by: Michel Normand <normand@fr.ibm.com>
14 years agottyclient_handler is only cleanup on disconnect
Michel Normand [Wed, 7 Oct 2009 14:06:08 +0000 (16:06 +0200)]
ttyclient_handler is only cleanup on disconnect

this is only a code split to show the real functionality of this
function that is not expecting any received data on the connection

Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agochange the way tty service is added to mainloop
Michel Normand [Wed, 7 Oct 2009 14:06:08 +0000 (16:06 +0200)]
change the way tty service is added to mainloop

Move the tty service handler to use the mainloop for a future
consistent usage.

Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agoaccept commands from root
Michel Normand [Wed, 7 Oct 2009 14:06:08 +0000 (16:06 +0200)]
accept commands from root

Commands should be accepted when they are coming from root.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Signed-off-by: Michel Normand <normand@fr.ibm.com>
14 years agolxc_af_unix_rcv_credential to report rcvd length
Michel Normand [Wed, 7 Oct 2009 14:06:08 +0000 (16:06 +0200)]
lxc_af_unix_rcv_credential to report rcvd length

to have better error reporting done by caller.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Signed-off-by: Michel Normand <normand@fr.ibm.com>
14 years agoexport struct lxc_handler from start.c to start.h
Michel Normand [Wed, 7 Oct 2009 14:06:08 +0000 (16:06 +0200)]
export struct lxc_handler from start.c to start.h

Will be required by a futur patch

Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agolocal struct name changed in mainloop.c
Michel Normand [Wed, 7 Oct 2009 14:06:08 +0000 (16:06 +0200)]
local struct name changed in mainloop.c

Two files have each their own structure definition with the same
name. The types name don't conflict but in the name of sanity, let's
rename these structures.

not critical isn't it :)

Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agokeep rcfile for lxc-execute as already done for lxc-create
Michel Normand [Wed, 7 Oct 2009 08:05:39 +0000 (10:05 +0200)]
keep rcfile for lxc-execute as already done for lxc-create

The code previously added in lxc-create with
commit d7efa8fcbf0911f93c83dc06a708e7d73833dce3
is also required in lxc-execute.
So make this code common for the two callers.

Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
15 years agoFix lxc-cgroup-get
Daniel Lezcano [Wed, 19 Aug 2009 20:14:17 +0000 (22:14 +0200)]
Fix lxc-cgroup-get

Make lxc_cgroup_get returns the number of bytes read and
use this value to "printf" it.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
15 years agodon't generate Changelog
Daniel Lezcano [Tue, 18 Aug 2009 21:28:42 +0000 (23:28 +0200)]
don't generate Changelog

Do not generate the changelog with the dist tarball.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
15 years agoinitialize lxc_fd_list before WARN return path
Ken-ichirou MATSUZAWA [Tue, 18 Aug 2009 21:28:42 +0000 (23:28 +0200)]
initialize lxc_fd_list before WARN return path

We should initialize lxc_fd_list before opendir in
__lxc_fd_collect_inherited in case of opendir returns error.

Signed-off-by: Ken-ichirou MATSUZAWA <chamas@h4.doin.ne.jp>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
15 years agolxc build fix for Suse
Jiri Slaby [Tue, 18 Aug 2009 21:28:42 +0000 (23:28 +0200)]
lxc build fix for Suse

Hi,

I have to use the attached patch to allow lxc building in the SUSE build
system. It uses as-needed flag and build thus fails, since -lutil is not
at the appropriate place on the command line.

js
suse labs

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
15 years agoInclude <sys/socket.h> before checking for netlink
Guido Trotter [Sun, 26 Jul 2009 15:44:12 +0000 (17:44 +0200)]
Include <sys/socket.h> before checking for netlink

With some versions of the compiler/headers linux/netlink.h won't compile
if sys/socket.h is defined before it.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Signed-off-by: Guido Trotter <ultrotter@quaqua.net>
15 years agoDistribute manpages in source tarball
Guido Trotter [Sun, 26 Jul 2009 15:44:11 +0000 (17:44 +0200)]
Distribute manpages in source tarball

Ship the manpages in the source tarball made by 'make dist', and clean
them up only during the 'make maintainer-clean' step. This allows
distributions not to depend on docbook at lxc build time, because the
manpages are already there.

Also update the configure warning message to sound less scary.

Signed-off-by: Guido Trotter <ultrotter@quaqua.net>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
15 years agoRemove unused --with-kernel-release option
Guido Trotter [Sun, 26 Jul 2009 15:44:11 +0000 (17:44 +0200)]
Remove unused --with-kernel-release option

This was a leftover from the already-removed
network-destruction-on-container shutdown code.

Signed-off-by: Guido Trotter <ultrotter@quaqua.net>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
15 years agofix the document according the current version
Daniel Lezcano [Fri, 24 Jul 2009 14:41:27 +0000 (16:41 +0200)]
fix the document according the current version

Remove the comment about sharing /dev and fix the lxc-ps option
format.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
15 years agoclose also inherited fd in lxc-execute
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>
15 years agodisplay an explicit warning when netlink headers are missing
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>
15 years agoadd some traces in the code for the logger
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>
15 years agofix cgroup trace
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>
15 years agochange version to 0.6.3
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>
15 years agoSpecify in the debian script an extra fstab file
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>
15 years agoadd clone2 for ia64
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>