Commit Graph

325 Commits

Author SHA1 Message Date
KATOH Yasufumi
be54cb1c55 doc: Always include the Japanese lxc-top manpage
Update for commit e71549f

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-12-02 10:56:03 -05:00
KATOH Yasufumi
c881c406ac Add the Japanese translation for the lxc.init_cmd config option
Update for commit 67c660d

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-12-02 10:55:56 -05:00
Stéphane Graber
e71549fc7e doc: Always include the lxc-top manpage
Since it's no longer written in lua.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2014-12-01 13:46:37 -05:00
Stéphane Graber
67c660d0aa Define a new lxc.init_cmd config option
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Dwight Engen <dwight.engen@oracle.com>
2014-12-01 13:46:11 -05:00
Stéphane Graber
c464fd7e01 tabs/spaces consistency
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2014-12-01 13:44:11 -05:00
KATOH Yasufumi
fb26e957f1 doc: change "-t" option of lxc-create(1) to being required
* fix "reg" to "req" in English (fix for commit b8683fe)
* change "opt" to "req" in Japanese

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-11-26 10:33:25 -05:00
KATOH Yasufumi
3726cda21a doc: Update kernel and cgroup info in Japanese lxc(7)
Update for commit 0dcbd62

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-11-25 14:05:14 -05:00
Silvio Fricke
b8683fefa9 lxc-create -t option is not optional
Closes: #355

Signed-off-by: Silvio Fricke <silvio.fricke@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-11-24 22:46:50 -05:00
Stéphane Graber
0dcbd62472 Fix the lxc manpage a bit
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-11-24 16:10:01 -05:00
KATOH Yasufumi
a1dd59de35 doc: Drop lxc.pivotdir from Japanese lxc.container.conf(5)
Update for commit 2d489f9

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-09-25 16:03:38 -04:00
KATOH Yasufumi
a5475f8f44 doc: Update Japanese lxc-top(1) for porting C version
Update for commit 7dc6f6e

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-09-24 11:26:04 -04:00
KATOH Yasufumi
edf3a692c7 doc: Add lxc.aa_allow_incomplete flag to Japanese man
Update Japanese lxc.container.conf(5) for commit 93c709b

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-09-24 11:25:58 -04:00
Dwight Engen
7dc6f6e279 port lxc-top from lua to C for wider availability
- keep but rename the lua version as an example of how to use the lua API

- got rid of the fairly useless --max argument

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-09-23 15:23:05 -04:00
KATOH Yasufumi
b58575f748 doc: Add description about ignoring lxc.cgroup.use when using cgmanager
Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-09-23 10:16:16 -04:00
Serge Hallyn
93c709b231 document the new lxc.aa_allow_incomplete flag
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-09-22 17:29:30 -04:00
Serge Hallyn
2d489f9e87 pivot_root: switch to a new mechanism (v2)
This idea came from Andy Lutomirski.  Instead of using a
temporary directory for the pivot_root put-old, use "." both
for new-root and old-root.  Then fchdir into the old root
temporarily in order to unmount the old-root, and finally
chdir back into our '/'.

Drop lxc.pivotdir from the lxc.container.conf manpage.

Warn when we see a lxc.pivotdir entry (but keep it in the
lxc.conf for now).

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-09-22 17:27:20 -04:00
KATOH Yasufumi
b0e26ca77b doc: Translate lxc-checkpoint(1) into Japanese
Update for commit 735f2c6

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-08-27 10:47:41 -04:00
Tycho Andersen
735f2c6e50 Add support for checkpoint and restore via CRIU
This patch adds support for checkpointing and restoring containers via CRIU.
It adds two api calls, ->checkpoint and ->restore, which are wrappers around
the CRIU CLI. CRIU has an RPC API, but reasons for preferring exec() are
discussed in [1].

To checkpoint, users specify a directory to dump the container metadata (CRIU
dump files, plus some additional information about veth pairs and which
bridges they are attached to) into this directory. On restore, this
information is read out of the directory, a CRIU command line is constructed,
and CRIU is exec()d. CRIU uses the lxc-restore-net callback (which in turn
inspects the image directory with the NIC data) to properly restore the
network.

This will only work with the current git master of CRIU; anything as of
a152c843 should work. There is a known bug where containers which have been
restored cannot be checkpointed [2].

[1]: http://lists.openvz.org/pipermail/criu/2014-July/015117.html
[2]: http://lists.openvz.org/pipermail/criu/2014-August/015876.html

v2: fixed some problems with the s/int/bool return code form api function
v3: added a testcase, fixed up the man page synopsis
v4: fix a small typo in lxc-test-checkpoint-restore
v5: remove a reference to the old CRIU_PATH, and a bad error about the same

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-08-26 10:40:05 -04:00
KATOH Yasufumi
8b3374e5e7 doc: Fix Japanese translation of lxc.containers.conf(5)
Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-08-18 09:01:25 -04:00
Lars Wikberg
70bb1a9ca7 doc: language correction
Signed-off-by: Lars Wikberg <lars.wikberg@anvia.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-08-15 21:08:23 -04:00
KATOH Yasufumi
48e60dfeef doc: add lxc.console.logpath to Japanese lxc.container.conf(5)
Update for commit 96f15ca

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-08-15 21:03:09 -04:00
Serge Hallyn
96f15ca18c add lxc.console.logpath
v2: add get_config_item

clear_config_item is not supported, as it isn't for lxc.console, bc
you can do 'lxc.console.logfile =' to clear it.  Likewise save_config
is not needed because the config is now just written through the
unexpanded char*.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-08-06 18:43:34 -04:00
KATOH Yasufumi
3ca73691b9 doc: Add 'zfs' to the parameter of -B option in lxc-create(1)
Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-08-04 15:46:49 -04:00
KATOH Yasufumi
03c315afc1 doc: Update the description of SELinux in Japanese lxc.container.conf(5)
Update for commit 719fae0

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-08-04 15:46:47 -04:00
KATOH Yasufumi
9231d3a4bb doc: Add the description of lxc.environment to Japanese lxc.container.conf(5)
Update for commit 7c66172

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-08-04 15:46:45 -04:00
KATOH Yasufumi
36c94e0d58 doc: Change default to "-d" in Japanese lxc-start(1)
Update for commit c00f3f3

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-08-04 15:46:42 -04:00
KATOH Yasufumi
22c36623bb doc: Add -F option to Japanese lxc-start(1)
Update for commit 476d302

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-08-04 15:46:40 -04:00
Dwight Engen
719fae07bf provide an example SELinux policy for older releases
The virtd_lxc_t type provided by the default RHEL/CentOS/Oracle 6.5
policy is an unconfined_domain(), so it doesn't really enforce anything.
This change will provide a link in the documentation to an example
policy that does confine containers.

On more recent distributions with new enough policy, it is recommended
not to use this sample policy, but to use the types already available
on the system from /etc/selinux/targeted/contexts/lxc_contexts, ie:

process = "system_u:system_r:svirt_lxc_net_t:s0"
file = "system_u:object_r:svirt_sandbox_file_t:s0"

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-07-31 14:12:25 -04:00
Matt Palmer
7c6617262d Support providing env vars to container init
It's quite useful to be able to configure containers by specifying
environment variables, which init (or initscripts) can use to adjust the
container's operation.

This patch adds one new configuration parameter, `lxc.environment`, which
can be specified zero or more times to define env vars to set in the
container, like this:

    lxc.environment = APP_ENV=production
    lxc.environment = SYSLOG_SERVER=192.0.2.42
    lxc.environment = SOMETHING_FUNNY=platypus

Default operation is unchanged; if the user doesn't specify any
lxc.environment parameters, the container environment will be what it is
today ('container=lxc').

Signed-off-by: Matt Palmer <mpalmer@hezmatt.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-07-31 13:54:20 -04:00
Stéphane Graber
c00f3f36e1 lxc-start: Daemonize by default
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-07-31 13:46:51 -04:00
Stéphane Graber
476d302ca2 lxc-start: Add -F (foreground) option
Introduce a new -F option (no-op for now) as an opposite of -d.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-07-31 13:46:31 -04:00
KATOH Yasufumi
16a410466e doc: Add mention that veth.pair is ignored for unpriv in Japanese man
Update Japanese lxc.container.conf(5) for commit 8982c0f

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-07-16 12:42:25 -04:00
Stéphane Graber
8982c0fd5e
doc: Mention that veth.pair is ignored for unpriv
veth.pair is ignore for unprivileged containers as allowing an
unprivileged user to set a specific device name would allow them to
trigger actions in tools like NetworkManager or other uevent based
handlers that may react based on specific names or prefixes being used.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2014-07-15 21:32:46 -04:00
KATOH Yasufumi
f36062dc50 doc: Update Japanese lxc.container.conf(5) for lxc.cap.keep = none
Update for commit 7035407

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-06-24 16:00:25 -04:00
Dwight Engen
7035407c96 allow lxc.cap.keep = none
Commit 1fb86a7c introduced a way to drop capabilities without having to
specify them all explicitly. Unfortunately, there is no way to drop them
all, as just specifying an empty keep list, ie:

    lxc.cap.keep =

clears the keep list, causing no capabilities to be dropped.

This change allows a special value "none" to be given, which will clear
all keep capabilities parsed up to this point. If the last parsed value
is none, all capabilities will be dropped.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-06-20 14:08:00 -04:00
KATOH Yasufumi
99e616a668 doc: Update Japanese lxc-snapshot(1) for adding the description of destroy
Update for commit 18aa217

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-06-20 14:07:40 -04:00
Serge Hallyn
18aa217bb1 snapshots: move snapshot directory
Originally we kept snapshots under /var/lib/lxcsnaps.  If a
separate btrfs is mounted at /var/lib/lxc, then we can't
make btrfs snapshots under /var/lib/lxcsnaps.

This patch moves the default directory to /var/lib/lxc/c/snaps.
If /var/lib/lxcsnaps already exists, then we continue to use that.

add c->destroy_with_snapshots() and c->snapshot_destroy_all()
API methods.  c->snashot_destroy_all() can be triggered from
lxc-snapshot using '-d ALL'.  There is no command to call
c->destroy_with_snapshots(c) as of yet.

lxclock: use ".$lxcname" for container lock files
that way we can use /run/lock/lxc/$lxcpath/$lxcname/snaps as a
directory when locking snapshots without having to worry about
/run/lock//lxc/$lxcpath/$lxcname being a file.

destroy: split off a container_destroy
container_destroy() doesn't check for snapshots, so snapshot_rename can
use it.  api_destroy() now does check for snapshots (previously it only
checked for fs - i.e. overlayfs/aufs - snapshots).

Add destroy to the manpage, as it was previously undocumented.

Update snapshot testcase accordingly.

[ rebased in the face of commits 840f05df and 7e36f87e. ]

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: S.Çağlar Onur <caglar@10ur.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-06-18 16:28:39 -05:00
KATOH Yasufumi
0f84d97e6d doc: Fix typo in lxc-autostart(1)
Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-06-05 09:31:19 -04:00
KATOH Yasufumi
f57517ef96 doc: Update Japanese man pages for the description of boot and group handling
Update lxc-autostart(1) and lxc.container.conf(5) for commit 015f0dd.

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-06-05 09:31:17 -04:00
Michael H. Warfield
015f0dd792 lxc-autostart: rework boot and group handling
This adds new functionality to lxc-autostart.

*) The -g / --groups option is multiple cummulative entry.
	This may be mixed freely with the previous comma separated
	group list convention.  Groups are processed in the
	order they first appear in the aggregated group list.

*) The NULL group may be specified in the group list using either a
	leading comma, a trailing comma, or an embedded comma.

*) Booting proceeds in order of the groups specified on the command line
	then ordered by lxc.start.order and name collalating sequence.

*) Default host bootup is now specified as "-g onboot," meaning that first
	the "onboot" group is booted and then any remaining enabled
	containers in the NULL group are booted.

*) Adds documentation to lxc-autostart for -g processing order and
	combinations.

*) Parameterizes bootgroups, options, and shutdown delay in init scripts
	and services.

*) Update the various init scripts to use lxc-autostart in a similar way.

Reported-by: CDR <venefax@gmail.com>
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Michael H. Warfield <mhw@WittsEnd.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-06-03 11:10:01 -04:00
Stéphane Graber
16bc569bc3
Fix syntax error in japanese manpage
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2014-05-19 23:03:43 +02:00
KATOH Yasufumi
a4dbc45fc7 doc: Update Japanese lxc.container.conf(5) for lxc.rootfs conventions
Update for commit f1c26f2

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-05-19 18:09:06 +02:00
KATOH Yasufumi
e053b31ef0 doc: Update Japanese lxc.container.conf(5) for guidance of lxc.mount.entry
Update for commit 6191f4f

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-05-19 18:09:02 +02:00
Serge Hallyn
6191f4f421 lxc.container.conf(5): update guidance for lxc.mount.entry mount target
For years it has been best practice to use a relative path as
the mount target.  But the manpage hasn't reflect that.  Fix it.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Dwight Engen <dwight.engen@oracle.com>
2014-05-16 14:26:52 -04:00
Serge Hallyn
f1c26f2cbd lxc.container.conf: document the type: lxc.rootfs conventions
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Dwight Engen <dwight.engen@oracle.com>
2014-05-16 09:58:22 -04:00
KATOH Yasufumi
58291e3a43 doc: Fix Japanese lxc.container.conf(5)
commit aafea1f was incomplete.

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-05-08 10:53:08 -05:00
KATOH Yasufumi
aafea1f750 doc: Update lxc.container.conf(5) for improving lxc.mount.auto
Update for commit 0769b82

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2014-05-06 16:52:22 -05:00
KATOH Yasufumi
cf5f31286e doc: Update Japanese lxc.container.conf(5) for mounting /sys/fs/cgroup rw
Update for commit b46f055

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2014-05-06 16:52:21 -05:00
Christian Seiler
0769b82a42 lxc.mount.auto: improve defaults for cgroup and cgroup-full
If the user specifies cgroup or cgroup-full without a specifier (:ro,
:rw or :mixed), this changes the behavior. Previously, these were
simple aliases for the :mixed variants; now they depend on whether the
container also has CAP_SYS_ADMIN; if it does they resolve to the :rw
variants, if it doesn't to the :mixed variants (as before).

If a container has CAP_SYS_ADMIN privileges, any filesystem can be
remounted read-write from within, so initially mounting the cgroup
filesystems partially read-only as a default creates a false sense of
security. It is better to default to full read-write mounts to show the
administrator what keeping CAP_SYS_ADMIN entails.

If an administrator really wants both CAP_SYS_ADMIN and the :mixed
variant of cgroup or cgroup-full automatic mounts, they can still
specify that explicitly; this commit just changes the default without
specifier.

Signed-off-by: Christian Seiler <christian@iwakd.de>
Cc: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2014-05-06 10:20:10 -05:00
Christian Seiler
b46f055358 cgfs: don't mount /sys/fs/cgroup readonly
Ubuntu containers have had trouble with automatic cgroup mounting that
was not read-write (i.e. lxc.mount.auto = cgroup{,-full}:{ro,mixed}) in
containers without CAP_SYS_ADMIN. Ubuntu's mountall program reads
/lib/init/fstab, which contains an entry for /sys/fs/cgroup. Since
there is no ro option specified for that filesystem, mountall will try
to remount it readwrite if it is already mounted. Without
CAP_SYS_ADMIN, that fails and mountall will interrupt boot and wait for
user input on whether to proceed anyway or to manually fix it,
effectively hanging container bootup.

This patch makes sure that /sys/fs/cgroup is always a readwrite tmpfs,
but that the actual cgroup hierarchy paths (/sys/fs/cgroup/$subsystem)
are readonly if :ro or :mixed is used. This still has the desired
effect within the container (no cgroup escalation possible and programs
get errors if they try to do so anyway), while keeping Ubuntu
containers happy.

Signed-off-by: Christian Seiler <christian@iwakd.de>
Cc: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2014-05-06 10:20:08 -05:00