Commit Graph

758 Commits

Author SHA1 Message Date
Daniel Lezcano
f1fa1a0866 generate locales on debian
Let's do like the ubuntu template and generate locales automatically.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-06-07 11:33:55 +02:00
Daniel Lezcano
5bad66ba56 ubunutu - fix ssh runlevel stop condition
The default ssh upstart configuration makes the daemon to respawn
either if we are shutdowning.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-06-07 11:33:55 +02:00
Wilhelm Meier
bc24fe4d8a few enhancement on the ubuntu template
Improved and cleanup the ubuntu template.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Signed-off-by: Wilhelm Meier <wilhelm.meier@fh-kl.de>
2010-06-07 11:33:55 +02:00
Daniel Lezcano
c01d62f21b move script templates to an adequate place
At present the lxc-{template} scripts are installed in the $bindir.
This is not the right place as specified by the FHS, so they go to
$libdir/lxc/templates.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-06-07 11:33:55 +02:00
Daniel Lezcano
d6b1784e1e add console login in ubuntu
Added console login

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-06-07 11:33:55 +02:00
Andrew Phillips
a740592509 Fix spec file
After I resynced to git head I noticed that this commit;
http://lxc.git.sourceforge.net/git/gitweb.cgi?p=lxc/lxc;a=commit;h=d674be08d4b282bb4717c51440811e39d3c2431e

 broke the rpm build.

This patch fixes this.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Signed-off-by: Andrew Phillips <Andrew.Phillips@lmax.com>
2010-06-07 11:33:55 +02:00
Willem Meier
5b406adb50 fixes to the ubuntu template
- Make /var/run not a tmpfs
 - Generate and update locales
 - Be less verbose
 - Remove apt-utils package

Signed-off-by: Willem Meier <wilhelm.meier@fh-kl.de>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-06-02 15:18:17 +02:00
Greg Kurz
c147356ac8 kill white spaces in lxc_init.c
Signed-off-by: Greg Kurz <gkurz@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-06-02 15:03:34 +02:00
Michel Normand
14a198d5a7 README should not be a copy of lxc man page
so rewrite it to its minimum

Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-06-02 15:03:34 +02:00
Daniel Lezcano
32b37181ea fix busybox template
Fix various bug with the busybox template:
 * add a warning when busybox is not statically linked
 * delete the password for root (chpasswd is not available for all busybox)
 * add the new pts option

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-06-01 18:56:54 +02:00
Daniel Lezcano
19d618b113 change root passwd for debian template
Change default root password to 'root' and generate locales
automatically

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-06-01 18:56:54 +02:00
Daniel Lezcano
3a3ba44ac3 Fix ubuntu template
- Fixed rootfs path.
 - Removed network section, it should to be passed to the lxc-create
configuration option in order to concatenate the configuration files
 - Generate en_US local instead of de_DE

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-06-01 18:56:54 +02:00
Willem Meier
3f033aa847 ubunutu template
Ubuntu [lucid] template script.
Allows to create an ubuntu container with the template options.

Signed-off-by: Willem Meier <wilhelm.meier@fh-kl.de>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-06-01 18:56:54 +02:00
Daniel Lezcano
5fad0874c3 fix compilation warning
Fix compilation warning:

lxc_console.c: In function ‘master_handler’:
lxc_console.c:175: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-06-01 12:24:17 +02:00
Daniel Lezcano
0e391e57b0 fix compilation warnings
Fix the following warnings:

console.c: In function ‘console_handler’:
console.c:252: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result
console.c:254: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result
conf.c: In function ‘instanciate_veth’:
conf.c:1130: warning: ignoring return value of ‘mktemp’, declared with attribute warn_unused_result
conf.c:1135: warning: ignoring return value of ‘mktemp’, declared with attribute warn_unused_result
conf.c: In function ‘instanciate_macvlan’:
conf.c:1206: warning: ignoring return value of ‘mktemp’, declared with attribute warn_unused_result
af_unix.c: In function ‘lxc_af_unix_send_fd’:
af_unix.c:124: warning: dereferencing type-punned pointer will break strict-aliasing rules
af_unix.c: In function ‘lxc_af_unix_recv_fd’:
af_unix.c:169: warning: dereferencing type-punned pointer will break strict-aliasing rules
af_unix.c: In function ‘lxc_af_unix_send_credential’:
af_unix.c:195: warning: dereferencing type-punned pointer will break strict-aliasing rules
af_unix.c: In function ‘lxc_af_unix_rcv_credential’:
af_unix.c:237: warning: dereferencing type-punned pointer will break strict-aliasing rules

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-06-01 12:13:32 +02:00
Cedric Le Goater
196f1d54ce add restart framework
Signed-off-by: Cedric Le Goater <clg@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-06-01 11:44:44 +02:00
Michel Normand
fac80c8f42 lxc-unshare asprintf error checking
same correction in lxc_unshare.c as already done
in lxc_start.c and lxc_restart.c by Nathan in
commit fa9ab20562

Signed-off-by: Michel Normand <michel.mno@free.fr>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-05-31 11:56:47 +02:00
Michel Normand
7115cb787d update man pages about logpriority
Signed-off-by: Michel Normand <michel.mno@free.fr>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-05-31 11:56:47 +02:00
Michel Normand
12d75a6147 update .gitignore w/ autogen.sh created files
remove trailing / for .pc and patches
that may be symbolic links.

and remove all test/* files that do not exist anymore since
commit 92d385229b

Signed-off-by: Michel Normand <michel.mno@free.fr>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-05-31 11:56:47 +02:00
Michel Normand
a040ec723e remove remaining .cvsignore files
Signed-off-by: Michel Normand <michel.mno@free.fr>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-05-31 11:56:47 +02:00
Daniel Lezcano
5045eedff0 disable rootfs automatic detection
Avoid a warning at compile time by disabling temporary the code.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-05-28 17:39:11 +02:00
Daniel Lezcano
cc6f6dd7d8 fix pivot umount algorithm
Make a function and fix bad parameter to umount.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-05-28 17:39:11 +02:00
Daniel Lezcano
2b8b82807a change repository url in MAINTAINERS
Changed cvs to git url.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-05-28 17:39:11 +02:00
Daniel Lezcano
11eaec4c33 fix lxc-execute man page
On buggy docbook-utils, old syntax leads to a bad formatting.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-05-28 17:39:11 +02:00
Daniel Lezcano
9887d6c6c2 update checkpoint / restart man page
Notify the checkpoint / restart commands do nothing for the moment.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-05-28 17:01:45 +02:00
Daniel Lezcano
396639d424 update lxc-checkpoint / lxc-restart man
Add documentation for checkpoint / restart CLI.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-05-28 17:01:45 +02:00
Greg Kurz
8c94bc8551 assertion on lxc_checkpoint() return value
Buggy behaviour always deserves an assertion.

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>
2010-05-28 14:29:05 +02:00
Daniel Lezcano
b3df193c50 fix whitespace
Fix whitespace.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-05-28 11:49:25 +02:00
Daniel Lezcano
0cd0cf5c15 remove unused field
These fields were moved to another structure but not removed from
there.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-05-27 16:27:15 +02:00
Cedric Le Goater
2ac29abe45 use ptmxmode mount option
Save one call by using the ptmxmode mount option.

Signed-off-by: Cedric Le Goater <clg@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-05-27 16:16:30 +02:00
Daniel Lezcano
d674be08d4 move lxc-init to $libdir/lxc
As specified by FHS:

   /usr/lib includes object files, libraries, and internal binaries that
   are not intended to be executed directly by users or shell scripts.

   Applications may use a single subdirectory under /usr/lib. If an
   application uses a subdirectory, all architecture-dependent data
   exclusively used by the application must be placed within that
   subdirectory.


Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-05-27 14:27:13 +02:00
Daniel Lezcano
baf6671fd3 change the rootfs mount location and add the README
Previous path was $libdir/lxc, changed to $libdir/lxc/rootfs.
Added a README file to be placed in this directory, describing
the purpose of this empty directory. Having a file to be installed
in this directory makes the Makefile to automatically create the
directory at install time.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-05-27 14:27:13 +02:00
Michel Normand
b8da590f0e lxc-kill man update about SIGSTOP and SIGKILL
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-05-27 14:26:09 +02:00
Michel Normand
d0817ec91a remove obsolete lxc_utils.h
This file is a duplicate of utils.h

Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-05-27 12:17:40 +02:00
clg@linux.vnet.ibm.com
0af683cf29 drop capabilities in lxc-init (V2)
capabilities are reseted just after the filesystem is mounted.
lxc_setup_fs() is moved up, before the process is forked.

Signed-off-by: Cedric Le Goater <clg@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-05-27 12:17:40 +02:00
Cedric Le Goater
3c22086fe2 introduce a sync API
The following patch wrap the calls on the synchronisation
socketpair in a lxc_sync_ API. It hopefully clarifies what
is done in the start sequence to the expense of more lines
of code ...

Signed-off-by: Cedric Le Goater <clg@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-05-26 21:43:53 +02:00
Cedric Le Goater
ee70bf78e3 merge lxc_restart() and lxc_start()
now that we have specific operations and specific arguments for each
sequence, lxc_restart() and lxc_start() can easily be merged under
a common subroutine.

Signed-off-by: Cedric Le Goater <clg@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-05-26 16:54:48 +02:00
Cedric Le Goater
23c53af96d replace common start_arg by private start_arg
the following patch moves the start argument in private
structs which are opaque to lxc_spawn(). To achieve this goal,
we need to move the sv[2] socketpair and lxc_handler

Signed-off-by: Cedric Le Goater <clg@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-05-26 16:54:48 +02:00
Cedric Le Goater
ffe1e01a50 start sequence cleanups
These are trivial changes:
	start_arg->name is redundant with lxc_handler->name
	sv[2] can be stored directly under start_arg

Signed-off-by: Cedric Le Goater <clg@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-05-26 16:54:48 +02:00
Cedric Le Goater
32e1c76058 simplify lxc_spawn() gotos
label 'out_close' is used only once.

Signed-off-by: Cedric Le Goater <clg@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-05-26 16:54:48 +02:00
Cedric Le Goater
79fd982e91 introduce struct lxc_operations
struct lxc_operations offers 2 operations : start and post_start
which are used by the lxc-start and lxc-restart sequences to
define specific actions.

Signed-off-by: Cedric Le Goater <clg@fr.ibm.com>
2010-05-26 16:54:48 +02:00
Michel Normand
e6126dbe9f Add ops for start
In order to define a specific function for restart, let's create
an ops where we will be able to specify a function for restart too.

Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-05-26 16:54:48 +02:00
Michel Normand
fc25b815fd prepare do_start for restart code
In order to be able to use a single 'start' function for start
and restart, let's prepare do_start to get an extra statefile parameter.

Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-05-26 16:54:48 +02:00
Michel Normand
69ffa31110 move LXC_TTY_HANDLER_ADD/DEL out of init/fini in start.c
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-05-26 16:54:48 +02:00
Michel Normand
8f64a3f64f sigprocmask moved in fini of start.c
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-05-26 16:54:48 +02:00
Denis Rizaev
8ff3518040 fix initial run level
I did a little investigation about runlevels and i think we can assume
runlevels 2-5 as normal. So, we can check if system was in runlevel 2-5
and proc count is 1 and now we are in 0/6.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Signed-off-by: Denis Rizaev <Denis.Rizaev@trueoffice.ru>
2010-05-24 15:06:36 +02:00
Nathan Lynch
fa9ab20562 correct asprintf error checking
asprintf(3) returns -1 (not 0) on error.

Signed-off-by: Nathan Lynch <ntl@pobox.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-05-19 22:15:28 +02:00
Daniel Lezcano
5332bb844a Don't close fd 0, fd 1
That breaks the reboot because when we reexec, fd 0 and fd 1 will be
closed and these one are created by lxc, not inherited. 

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-05-19 22:15:28 +02:00
Daniel Lezcano
1362f2eba1 close socket command
We don't close the command socket after the transaction, that leads
to a fd leak.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-05-19 22:15:28 +02:00
Daniel Lezcano
da2aef7f9a fix indentation
Indent the signalfd structure definition correctly.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-05-19 22:15:28 +02:00