Commit Graph

1578 Commits

Author SHA1 Message Date
dlezcano
4c92bdfc1a Added the console error value
From: Daniel Lezcano <dlezcano@fr.ibm.com>

Added the console error value

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2008-11-25 12:51:52 +00:00
dlezcano
68cecc5398 Remove nsgroup link when destroying the container
From: Daniel Lezcano <dlezcano@fr.ibm.com>

Remove nsgroup link when destroying the container

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2008-11-25 12:50:20 +00:00
dlezcano
998dc19ad6 Fix some typos
From: Daniel Lezcano <dlezcano@fr.ibm.com>

Fixed some typos in the man pages

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2008-11-25 12:49:14 +00:00
dlezcano
f1d8791c17 Added missing lxc.7 man page
From: Daniel Lezcano <dlezcano@fr.ibm.com>

Added the file lxc.sgml.in to the repository.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2008-11-24 10:36:18 +00:00
dlezcano
6f8db4602a Hard code localstatedir in the scripts. pkgconfig is too difficult to handle
between 32bits and 64bits architecture and different pkgconfig conflict.
2008-11-21 18:20:48 +00:00
dlezcano
0387b7a0a7 Add a netstat per container
From: Daniel Lezcano <dlezcano@fr.ibm.com>

Added the ability to do netstat from outside of the container to see
network resources used by the container.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2008-11-21 18:19:36 +00:00
dlezcano
9d0195cb79 Remove lxc.pc pkgconfig usage 2008-11-21 18:17:38 +00:00
dlezcano
6ebc80f8d9 Fixed a typo 2008-11-21 18:16:39 +00:00
dlezcano
b322326203 Return error code in child process
From: Daniel Lezcano <dlezcano@fr.ibm.com>

Return the error code when the exec fails in the child process, that
decreases the granularity of the error given to the user.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2008-11-21 15:56:38 +00:00
dlezcano
6373bd687a Use pkgconfig to retrieve localstatedir
From: Matt Helsley <matthltc@us.ibm.com>

Use the pkgconfig to locate in the lxc scripts the place where .../var/lxc
is.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2008-11-20 19:57:47 +00:00
dlezcano
abd4a3b329 Disable test compilation by default
From: Daniel Lezcano <dlezcano@fr.ibm.com>

Disable the test programs compilation by default in order to reduce the
compilation time when generating rpm and dist.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2008-11-20 17:06:02 +00:00
dlezcano
7f989f01d5 Make the README file a copy of lxc.7
From: Daniel Lezcano <dlezcano@fr.ibm.com>

The man lxc.7 being complete enough, I copy the man to the README file.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2008-11-20 15:08:22 +00:00
dlezcano
8b8b04f80a Add lxc.7 man page
From: Daniel Lezcano <dlezcano@fr.ibm.com>

Added the overview man page for lxc.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2008-11-20 15:04:09 +00:00
dlezcano
8a67a2b2ea Added the man page lxc.conf.5
From: Daniel Lezcano <dlezcano@fr.ibm.com>

Added the man page for the lxc.conf configuration file.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2008-11-19 16:58:09 +00:00
legoater
ea3d71b1fc changed /var location
From: Cedric Le Goater <clg@fr.ibm.com>

changed /var location

Signed-off-by: Cedric Le Goater <clg@fr.ibm.com>
2008-11-19 11:08:06 +00:00
legoater
6c79a11ba0 fixed readlink to add an ending '\0'
From: Cedric Le Goater <clg@fr.ibm.com>

fixed readlink to add an ending '\0'

Signed-off-by: Cedric Le Goater <clg@fr.ibm.com>
2008-11-19 11:05:42 +00:00
dlezcano
b0e505c974 Add the lxc-cgroup man page
From: Daniel Lezcano <dlezcano@fr.ibm.com>

Added the lxc-cgroup man page

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2008-11-18 14:27:12 +00:00
dlezcano
d1de19abd0 Generate only if docbook is installed
From: Daniel Lezcano <dlezcano@fr.ibm.com>

Generate the man pages only if the docbook tool is available.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2008-11-18 14:03:57 +00:00
dlezcano
d823d5b966 Added the man.1 pages
From: Daniel Lezcano <dlezcano@fr.ibm.com>

Added the different man pages for the lxc commands. The generation of the
man pages relies on the docbook tool.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2008-11-18 13:45:49 +00:00
dlezcano
5c4886990b List the available containers and the processes belonging to such container.
From: Daniel Lezcano <dlezcano@fr.ibm.com>

This modification change the lxc-ps command and adds the lxc-ls command.

The lxc-ps command takes the container name argument and shows the processes
belonging to the specified container. The usual ps argument can be passed to
the lxc-ps to change the output.
Examples:
  lxc-ps -n foo --forest
  lxc-ps -n foo -o pid=

The lxc-ls command list the container name available on the system. This is
useful to retrieve information for each container.
Examples:
  for i in $(lxc-ls); do
	lxc-info -n $i
	lxc-ps -n $i --forest
  done

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2008-11-18 09:40:05 +00:00
dlezcano
e5bda9eed7 Return a lxc-error for creation and starting
From: Daniel Lezcano <dlezcano@fr.ibm.com>

Return a lxc-error when for the lxc_configure and lxc_setup function.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2008-11-17 18:22:29 +00:00
dlezcano
1f3da8f86c Handle the lock error and show message to user
From: Daniel Lezcano <dlezcano@fr.ibm.com>

Handle the lock error and show message to user.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2008-11-17 17:55:49 +00:00
dlezcano
e2bcd7db5e Add return error status in the different functions
From: Daniel Lezcano <dlezcano@fr.ibm.com>

Add the most known error to the different API to be followed up by the
caller, so we can later show a better message to the user when something
goes wrong. The error catching is coarse grain right now but will be improved,
step by step.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2008-11-17 16:01:34 +00:00
dlezcano
5841258071 Add error status for the API
From: Daniel Lezcano <dlezcano@fr.ibm.com>

Added the error codes and the corresponding strings to the liblxc, so
the error raised to the user can be more understandable.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2008-11-17 15:18:19 +00:00
dlezcano
2aa79ee787 Do some cleanup in the lxc.h file
From: Daniel Lezcano <dlezcano@fr.ibm.com>

Do some cleanup in the lxc.h file, remove dead code and move definition to
the right place.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2008-11-17 14:24:07 +00:00
dlezcano
cf6300c3f3 Remove the kill container processes code
From: Daniel Lezcano <dlezcano@fr.ibm.com>

Remove the kill container processes code because it can be implemented with
a very few scripting lines

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2008-11-17 14:15:40 +00:00
dlezcano
e7aa295e11 Setup the control group
From: Daniel Lezcano <dlezcano@fr.ibm.com>

Setup the control group when executing the container.
Remove the dead code.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2008-11-17 13:55:01 +00:00
dlezcano
b7c9b19991 Change at compilation time the destruction of the network devices
From: Daniel Lezcano <dlezcano@fr.ibm.com>

The future kernel version will automatically autodestroy the network devices
when the network namespace exits. This is not the case for the current version.
In order to handle the both cases, I added a configuration option to disable
the network destruction when the container exits:
	--disable-network-destroy

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2008-11-14 16:16:35 +00:00
dlezcano
6f4a37566a Fix cgroup configuration format
From: Daniel Lezcano <dlezcano@fr.ibm.com>

This modification change the configuration format. Instead of creating
a 'cgroup' directory with a file per controller, a single file is used
to store the different value for the control groups. That allows to assign
several values to the same controller like "devices.allow" and keep the same
assignation order as defined in the configuration.

In order to keep compatibility, when the old cgroup format is detected, it
is automatically converted to the new format.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2008-11-14 15:42:59 +00:00
dlezcano
b2b6c597df Default command is "/sbin/init" for lxc-start
From: Daniel Lezcano <dlezcano@fr.ibm.com>

When no command is specified is specified for lxc-start, the "/sbin/init"
is automatically used.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2008-11-14 15:35:40 +00:00
dlezcano
0780e34389 Add setpcap capabilty to be able to drop the sys_boot capabilty.
From: Daniel Lezcano <dlezcano@fr.ibm.com>

Previously, we dropped the CAP_SYS_BOOT capabilty. Unfortunatly if we are
non root user, we are not able to do that. So I had the CAP_SETPCAP to
lxc-execute and lxc-start command line to remove this capabilty.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2008-11-13 16:53:23 +00:00
dlezcano
0652697525 Fix function prototype
From: Daniel Lezcano <dlezcano@fr.ibm.com>

The lxc_start function prototype has been changed.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2008-11-13 15:23:44 +00:00
dlezcano
05f05512ed Replace lxc_execute by an intermediate lxc_init
From: Daniel Lezcano <dlezcano@fr.ibm.com>

The main difference between lxc_start and lxc_execute is the latter creates
an intermediate process to wait for all the childs. That allows to support
daemons or orphan process group for the pid namespace.

Having such difference makes the code to be duplicate between the two
functions. So instead of doing this, I create an intermediate <init> program
which is in charge to launch the specified command. This command is the
lxc-init program taking different options:
 --mount-procfs : mount the proc filesystem before exec'ing the command
 --mount-sysfs : mount the sys filesystem before exec'ing the command

A double dash indicates the end of the options of lxc-init and the beginning
of the command to be launched.

To summarize:
 * lxc_execute function is no more.
 * lxc-execute command uses the lxc_start function and launch the specified
command via lxc-init

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2008-11-13 15:21:55 +00:00
dlezcano
683c720b7e Fix typo.
From: Daniel Lezcano <dlezcano@fr.ibm.com>

Fix trivial typo

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2008-11-05 19:55:10 +00:00
dlezcano
752c0602f0 Add guidelines for contribution to the 'lxc' project
From: Daniel Lezcano <dlezcano@fr.ibm.com>

CONTRIBUTING file give the guidelines to submit patches to this project.
MAINTAINERS contains the maintainer name and mailing list to send the patches.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2008-11-05 19:51:21 +00:00
dlezcano
42ff343ddb From: Daniel Lezcano <dlezcano@fr.ibm.com>
Remove the CAP_SYS_BOOT capability from the bouding set, so we can poweroff,
halt, reboot the container safely without shutting down the real host.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2008-11-04 22:18:23 +00:00
dlezcano
96950ed0f4 From: Daniel Lezcano <dlezcano@fr.ibm.com>
To allow user to properly configure the location of lxcpath (/var/lxc),
it should be build based on variable 'localstatedir' instead of 'prefix'.

By default, localstatedir=$prefix/var
localstatedir can be set by the user during configure:

./configure --localstatedir=/var

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2008-11-04 22:16:21 +00:00
dlezcano
57545890fe From: Daniel Lezcano <dlezcano@fr.ibm.com>
Exit instead of returning in child process.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2008-11-04 21:52:48 +00:00
dlezcano
5f8dbb64c6 Redirect the Changelog diff to file instead of stdout 2008-10-28 22:38:23 +00:00
dlezcano
f04d36bf47 Generate a ChangeLog, if possible, and copy it to the dist directory in order
to be shipped with the release
2008-10-28 22:08:05 +00:00
dlezcano
732db53f60 Added a helper to generate the Changelog between two releases 2008-10-28 22:06:58 +00:00
dlezcano
693dcea5e4 Fixed different compilation scheme by making /var/lxc directory relative to
the installation prefix and by adding some extra path to search for the
'setcap' command.
2008-10-26 22:06:49 +00:00
dlezcano
65c46aeff2 Added automatic generation of packages and repository tagging 2008-10-24 22:08:25 +00:00
dlezcano
94253b66e4 Automatically generated now with cvs2cl command 2008-10-24 22:06:14 +00:00
dlezcano
3b164be6e7 Helper script to generate releases 2008-10-24 21:56:50 +00:00
dlezcano
6136d011de Version lxc-0.4.0 2008-10-24 21:33:51 +00:00
dlezcano
22ea48ce03 Added file capabilities to lxc-restart 2008-10-24 20:24:07 +00:00
dlezcano
805415fceb Give the ability to non-root user to play with the containers. This feature
relies on the file capabilities, when the lxc commands are installed, the
sys/net admin capabilities are given to these files. These capabilities are
not available for the application running inside the container.
2008-10-24 20:14:57 +00:00
dlezcano
96c9f969b6 Exit instead of returning in the child processes, otherwise the execution
path of the child will be wrong in case of error.
2008-10-24 20:11:25 +00:00
legoater
ae4c254760 removed opentty now useless and fixed pid of root process for restart 2008-10-23 13:09:01 +00:00