aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* use correct number of ttys during setuplxc_0_6_4-gentoo-2lxc_0_6_4-gentooSven Wegener2009-12-111-1/+1
| | | | | | | | | commit 985d15b106c8959ff130ba5425c2abbe36dc2cca "fix fdleak and errors in lxc_create_tty()" created a zero-sized malloc(), causing memory corruption. use config->tty like all the other code does. Signed-off-by: Sven Wegener <sven.wegener@stealer.net> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
* "Default" configuration may destroy host systemlxc_0_6_4-gentoo-1Andrian Nord2009-12-111-0/+5
| | | | | | | | | | | | | | | | | | | | | | | If you're running (by mistake or typo) (via lxc-start) container that does not exists it will run with lxc.rootfs=/, meaning that /sbin/init will restart initialization procedure, efficiently messing host's system, that may lead to unpredictable results or even destroy (make inaccessible) host system (by reseting network configuration or something like that). (Actually, it _did_ destroy system of everyone who tested this). Actually, I finally lost any meaning of having such a feature for full-system containers. You may not use hosts's FS - it's described at above. You may not use some temporary directory - that's nonsense. This patch forbinds starting container via lxc-start without rcfile and custom start program, but probably it fixes only small part of problem. I really don't see much sense in such a feature without ability of overriding 'default' setting with command line switches. Anyway, default behaviour should be as save as possible. Signed-off-by: Andrian Nord <NightNord@gmail.com> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
* pass lxc_conf to the lxc_start function instead of the rcfileDaniel Lezcano2009-12-117-44/+53
| | | | | | | | | | | The rcfile is parsed in the lxc_start function. This is not the place to do that. Let's the caller to do that. In the meantime, we have the lxc_conf structure filled right before calling the lxc_start function so we can do some sanity check on the configuration to not break the system when we launch the container. Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
* allow lxc.network.pair to specify host-side name for veth interfaceMichael Tokarev2009-12-113-4/+25
| | | | | | | | | | | Currently we allocate veth device with random name on host side, so that things like firewall rules or accounting does not work at all. Fix this by recognizing yet anothe keyword to specify the host-side device name: lxc.network.pair, and use it instead of random name if specified. Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
* lxc-ps typo in man lxclxc_0_6_4Michel Normand2009-11-241-1/+1
| | | | | | | Fix bad name parameter in the lxc-ps man page. Signed-off-by: Michel Normand <michel.mno@free.fr> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
* lxc-info to report the FROZEN stateMichel Normand2009-11-242-7/+11
| | | | | | | | this state is reported when the lxc-freeze command was issued on the container. Signed-off-by: Michel Normand <normand@fr.ibm.com> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
* fix fdleak and errors in lxc_create_tty()Michael Tokarev2009-11-241-13/+8
| | | | | | | | | | | | if, for some reason, openpty() fails, lxc_create_tty() will leak all previous ptys and leave the config structure in a inconsistent state (wrt the number of ptys actually opened) Fix that by explicitly closing all previously opened ptys in case of failure and by setting number of actually opened ttys after actual open Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
* version 0.6.4Daniel Lezcano2009-11-201-1/+1
| | | | Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
* fix rpm generation regarding latest modificationsDaniel Lezcano2009-11-201-1/+1
| | | | | | The configuration examples have been moved to doc/lxc/examples. Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
* check if lxc.netdev.link is set for macvlanMichael Tokarev2009-11-201-10/+10
| | | | | | | | | | | | Ensure that lxc.netdev.link is specified for macvlan interfaces, since it's required. While at it, simplify logic in instanciate_macvlan(): remove unnecessary-complicating goto statements (we only need to perform a cleanup in one place) Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
* allow link-less veth devicesMichael Tokarev2009-11-201-3/+2
| | | | | | | | | Before, a veth device pair required a link which was treated as a bridge device. Code crashed if there was no lxc.network.link specified. Fix that by allowing lxc.network.link to be unset Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
* rollback configuration is a fileDaniel Lezcano2009-11-204-6/+8
| | | | | | | The container will be a directory where the user can store everything, so we create one directory and store a configuration file inside. Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
* Do not chdir when daemonizeDaniel Lezcano2009-11-201-2/+0
| | | | | | | | | | | | | | With the previous modifications, a temporary directory is created to mount the rootfs in order to have the system container to remount itself the '/' directory. But in case of daemonize, we change the directory, so when the rootfs is specified with a relative path, we can not access it. Don't chdir, as that will be done automatically later in the chroot setup. Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
* update the man pagesDaniel Lezcano2009-11-204-37/+42
| | | | | | Update the man pages regarding the different modifications. Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
* change C/R apiMichel Normand2009-11-196-61/+48
| | | | | | | Change Checkpoint / Restart API Signed-off-by: Michel Normand <normand@fr.ibm.com> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
* remove unused cr_plugin_columbia.cMichel Normand2009-11-195-169/+2
| | | | | | | Remove checkpoint / restart dead code. Signed-off-by: Michel Normand <normand@fr.ibm.com> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
* lxc_init better error reportingMichel Normand2009-11-191-2/+2
| | | | | | | Display the 'rcfile' value on error Signed-off-by: Michel Normand <normand@fr.ibm.com> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
* change network_netdev function parameterDaniel Lezcano2009-11-191-12/+25
| | | | | | A mindless change to encapsulate a little more the function. Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
* factor out common config evaluating codeMichael Tokarev2009-11-191-77/+51
| | | | | | | | | 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>
* rename struct lxc_netdev fields to match realityMichael Tokarev2009-11-193-17/+18
| | | | | | | | | | | | | | 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>
* update the man pagesDaniel Lezcano2009-11-195-23/+44
| | | | | | | | 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>
* export set_state functionMichel Normand2009-11-172-7/+8
| | | | | | | 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>
* add capabilities for lxc-checkpointMichel Normand2009-11-171-2/+6
| | | | | | | add capabilities for lxc-checkpoint Signed-off-by: Michel Normand <normand@fr.ibm.com> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
* lxc: move setup_fs to utils.cMichel Normand2009-11-173-38/+40
| | | | | | | 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>
* fix container find the previously created configurationDaniel Lezcano2009-11-172-1/+40
| | | | | | | | | | 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>
* lxc-netstat should use @LXCPATH@ for lxcpath=Andrian Nord2009-11-171-6/+1
| | | | | | | Typo ;) Signed-off-by: Andrian Nord <NightNord@gmail.com> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
* batched reads for lxc_consoleMichael Tokarev2009-11-171-4/+6
| | | | | | | | | | 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>
* host consoles/ttys in containersMichael Tokarev2009-11-171-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Choose configuration directoryAndrian Nord2009-11-171-2/+8
| | | | | | | | | | | 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>
* cleanup <lxc/lxc.h>Cedric Le Goater2009-11-1731-39/+81
| | | | | | | | <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>
* typo in 488624016575d092d56211347b2bbe8367cd339a (V2)Michel Normand2009-11-131-5/+6
| | | | | | | | 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>
* Fix lxc-netstat scriptDaniel Lezcano2009-11-131-16/+27
| | | | | | | | | | | | | 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>
* Q: general lxc architectureAndrian Nord2009-11-1311-21/+26
| | | | | | | | | | | 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>
* lxc lxc-sshd using new lxc.mount.entry keywordMichel Normand2009-11-131-12/+6
| | | | | Signed-off-by: Michel Normand <michel_mno@laposte.net> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
* lxc: remove lxc.mount setting in lxc-fedora scriptMichel Normand2009-11-131-11/+0
| | | | | | | | 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>
* lxc-debian using new lxc.mount.entry keywordMichel Normand2009-11-131-4/+3
| | | | | | | 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>
* lxc: add a new lxc.mount.entry keywordMichel Normand2009-11-133-12/+88
| | | | | | | | | | | | | 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>
* stop config reading if cgroup setting failedMichel Normand2009-11-131-3/+5
| | | | | | | 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>
* lxc-debian to not use empty mount tableMichel Normand2009-11-131-4/+7
| | | | | | | | 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>
* Replace create/destroy by a scriptDaniel Lezcano2009-11-1312-631/+182
| | | | | | | | 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>
* Allows a container to run without previous creationDaniel Lezcaon2009-11-135-37/+22
| | | | | | | | | | | | | | | | | | 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>
* liblxc: Fix compile failureDhaval Giani2009-11-131-2/+0
| | | | | | | | | | | | | | | | | | | | 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>
* Fix abstract af_unix socket nameDaniel Lezcano2009-11-121-1/+2
| | | | | | Fix a typo making the abstract af_unix socket name to be wrong. Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
* Remove the usage of a lock fileDaniel Lezcano2009-11-127-178/+10
| | | | | | | 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>
* export log function so it can be used by library userCedric Le Goater2009-11-121-0/+4
| | | | | | | 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>
* Remove an unnecessary entry in the spec fileRyousei Takano2009-11-111-1/+0
| | | | | | | | | | 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>
* ipv6 interfaces added with /0 prefixAndrian Nord2009-11-091-1/+1
| | | | | | | | 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>
* lxc: lxc version to reflect string in AC_INIT (V2)Michel Normand2009-11-044-11/+3
| | | | | | | | | | | 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>
* configure.ac - allow user to switch off/on documentation generationAndrian Nord2009-11-041-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* lxc /cgroup/name/ not removed at container endMichel Normand2009-11-032-12/+16
| | | | | | | | | 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>