cgmanager: chown cgroups to the container root

After this patch, starting an unprivileged container using
cgmanager gets the cgroup chown to the container root, so
that it can install the cgmanager (proxy) and make cgroup
requests.

(Still desirable and not in this patch is the automatic setup of
/sys/fs/cgroup/manager/sock, which you can currently do with
two lxc.mount.entries)

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
lxc-download: Fix to work without mktemp

mktemp isn't always available in busybox.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
lxc-alpine: copy /etc/TZ to container if present

Signed-off-by: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
lxcapi_clone: exit early on snapshot clones

If the user explicitly asks for a snapshot clone (in which
case maybe_snap is not set), we cannot abide this currently.
Rather than exit later with more cryptic error messages, exit
out early.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
close the fd on error

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
lxccontainer: remove PID file after lxc_start return

Make the way symmetric. This also fix the file leak in
daemon model.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
Ignore lxc-test-usernic

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Implement lxc.rootfs.options

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
lxc-download: Tweak cache location

 - Also include the variant in the path
 - Fix invalid LXC_CACHE_BASE
 - Drop redundant code

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>