destroy the original container after making sure the snapshot exists (fixes #224)

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
attach: get personality through get_config command

Newer kernels optionally disallow reading /proc/$$/personality by
non-root users.  We can get the personality through the lxc command
interface, so do so.

Also try to be more consistent about personality being a signed long.
We had it as int, unsigned long, signed long throughout the code.

(This addresses bug
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1322067 :
3.15.0-1.x breaks lxc-attach for unprivileged containers)

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
Fix incorrect value used in comparison

Signed-off-by: Bartosz Tomczyk <bartekplus@gmail.com>
Acked-by: Dwight Engen <dwight.engen@oracle.com>
configure.ac: don't let -lcgmanager end up in LIBS

AC_SEARCH_LIBS always places the library being queried into LIBS.  We
don't want that - we were only checking whether a function is
available.  Not everything (notably not init.lxc.static) needs to
link against -lcgmanager.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
point user to updated man page in template boilerplate

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
lxc-plamo: fix for configuring network interface

Fix configure_plamo so as not to configure wireless network interface
in containers even if the host uses wireless network interface.

Signed-off-by: TAMUKI Shoichi <tamuki@linet.gr.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
Corrected debug message

Signed-off-by: Bartosz Tomczyk <bartekplus@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
Free lxc configuration structure

Signed-off-by: Bartosz Tomczyk <bartekplus@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
python3: Don't require a template name

The template name isn't required, if it's not passed, then create will
simply be asked to create a container without a rootfs.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
python3: Handle invalid global config keys

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
lxcapi_snapshot: check that c is defined

before using it, like the other snapshot api methods do.

This will need to go into stable-1.0 as well.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
lxc-fedora.in: Correct some systemd target setups.

Set the halt.target action to be sigpwr.target.  This allows
SIGPWR to properly shut the container down from lxc-stop.

Renable the systemd-journald.service.

Signed-off-by: Michael H. Warfield <mhw@WittsEnd.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
lxc-download: Attempt to get the GPG key 3 times

This is to deal with the GPG pool occasionaly yielding broken servers.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
Specially handle block device rootfs

It is not possible to mount a block device from a non-init user namespace.
Therefore if root on the host is starting a container with a uid
mapping, and the rootfs is a block device, then mount the rootfs before
we spawn the container init task.

This addresses https://github.com/lxc/lxc/issues/221

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
Try to be more helpful on container startup failure

This hides some of the confusing "command X failed to receive response"
why are usually caused by another more understandable error.

On failure to start() from lxc-start, a new error message is displayed,
suggesting the user sets logfile and loglevel and if using -d, restarts
the container in the foreground instead.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
Backport of autoboot/autostart rollup to stable-1.0

Full backport of the autostart / autoboot rollup patch from
master to stable-1.0.

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>
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>
python3: Fix crashes in snapshot()

This makes sure all PyObject structs are always initialized to NULL,
this will fix issues such as (issue #239).

Also add a snapshot/list/restore testcase to the python3 api test code.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
container start: check for start hooks in container rootfs

Do so early enough that we can report a meaningful failure.

(This should fix https://github.com/lxc/lxc/issues/225)

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
cgfs: Log the whole cgroup path too

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>