Update license of lsm/selinux.c

Change the license from GPL to LGPL to avoid a tricky license situation
for liblxc.so.

Signed-off-by: Jonas Eriksson <jonas.eriksson@enea.com>
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
templates: improve refusing to run unprivileged

For all templates except lxc-ubuntu-cloud and lxc-download, detect not
only --mapped-uid but also --mapped-gid and error out.  Detecting will
not be done after -- parameter because of non-option parameters.

Also, change the mode of lxc-archlinux.in 100755 to 100644.

Signed-off-by: TAMUKI Shoichi <tamuki@linet.gr.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
doc: Add the common options section to lxc-create(1)

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
move cgroup.c to cgfs.c in preparation for backend change

This is just a move without any changes so history will be preserved.
Makefile.am was modified so that lxc will still build and run.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
split cgroup handling into discrete backends

- refactor cgroup into two backends, the classic cgfs driver and the new
  cgmanager. Instead of lxc_handler knowing about the internals of each,
  have it just store an opaque pointer to a struct that is private to
  each backend.

- rename a couple of cgroup functions for consistency: those that are
  considered an API (ie. exported by lxc.h) begin with lxc_ and those that
  are not are just cgroup_*

- made as many backend routines static as possible, only cg*_ops_init is
  exported

- made a nrtasks op which is needed by the utmp code for monitoring
  container shutdown, currently only implemented for the cgfs backend

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
download: Force hkp on port 80 (for http proxies)

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Add missing include of signal.h

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

This op will be used on older kernels where container shutdown via reboot(2)
is not implemented and we use the utmp watching code.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
download: Fix previous change

The previous change to support http proxies only worked when http_proxy
was set... Instead add some detection code and only use :80 when using
http_proxy.

That's a bit of a workaround, but it's the only way I could find to get
GPG to work with http_proxy.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
templates: Make sure usual locations are in PATH

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
download: Use port-80 pool for gpg over http

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
tests: Pass http_proxy through sudo environment

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
cgmanager: only include CFLAGS and LDADD when needed

lxc-cgroup doesn't depend on cgmanager

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
change version to 1.0.0.beta4 in configure.ac

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
log: Don't crash when name is NULL

This fixes a crash in lxc-autostart following the addition of
lxc_log_init as lxc-autostart doesn't use the name property.

Signed-off-by: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
log: Drop trailing \n from log messages

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
lxc_autostart: Update following shutdown() API change

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