]> git.proxmox.com Git - mirror_lxc.git/log
mirror_lxc.git
11 years agofix expansion of LXCPATH,LXCROOTFSMOUNT,LXCTEMPLATEDIR
Dwight Engen [Tue, 11 Sep 2012 21:06:05 +0000 (17:06 -0400)]
fix expansion of LXCPATH,LXCROOTFSMOUNT,LXCTEMPLATEDIR

These variables are not expanded correctly in doc/lxc-create.sgml.in
and a workaround is in place to ensure ${localstatedir}, and ${datadir}
are set in the various shell scripts that use it. There is no workaround
to ensure ${datadir} is set in src/lxc/lxc-create.in, nor is
${localstatedir} set in templates/lxc-altlinux.in so I think that these
are currently broken.

Using AS_AC_EXPAND instead of AC_SUBST fixes these problems and removes
the need for the workarounds. In addition the lxc-start-ephemeral.in
script can be autoconf'ed instead of sed'ed by the makefile.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
11 years agolxc-rpm-build
Dwight Engen [Tue, 11 Sep 2012 18:30:22 +0000 (14:30 -0400)]
lxc-rpm-build

Fix building of rpm by non-root user. Include templates in rpm, fix rpm path of
lxc-init.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
11 years agolxc-doc-synopsis-args
Dwight Engen [Mon, 10 Sep 2012 20:49:31 +0000 (16:49 -0400)]
lxc-doc-synopsis-args

I was getting raw nroff ".SH DESCRIPTION" in my man pages. This fixes
the synopsis cmd args so that doesn't happen. Added replaceable to a few
arguments.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
11 years agolxc-pkgconfig-dir
Dwight Engen [Mon, 10 Sep 2012 14:28:37 +0000 (10:28 -0400)]
lxc-pkgconfig-dir

Put pkg-config .pc file in libdir.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
11 years agolog errno when pclose fails
Serge Hallyn [Fri, 7 Sep 2012 03:16:55 +0000 (22:16 -0500)]
log errno when pclose fails

When lxc is executing a script and pclose fails, log the
errno to help debug what happened.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agoPass the container name to copy_configuration in lxc-lenny
Stéphane Graber [Thu, 6 Sep 2012 14:59:57 +0000 (10:59 -0400)]
Pass the container name to copy_configuration in lxc-lenny

This fixes a case where lxc.utsname would be set empty as copy_configuration
wasn't getting the container name.

Signed-off-by: Rex Tsai (蔡志展) <rex.tsai@canonical.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agoAdd SIGINT and SIGPWR handler in lxc-debian
Stéphane Graber [Thu, 6 Sep 2012 14:57:20 +0000 (10:57 -0400)]
Add SIGINT and SIGPWR handler in lxc-debian

This adds a SIGINIT and SIGPWR handler in the default inittab for
the Debian template. This allows lxc-shutdown/lxc-restart and their API calls
to properly shutdown or reboot the container.

Signed-off-by: Rex Tsai (蔡志展) <rex.tsai@canonical.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agoDon't hardcode path to templates
Stéphane Graber [Thu, 6 Sep 2012 03:54:51 +0000 (23:54 -0400)]
Don't hardcode path to templates

configure.ac used to set the template path to /usr/share/lxc/templates.
Instead use ${datadir} to make it follow ${prefix}.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agolxc-destroy: Separately rm rootfs if it is a symlink
Serge Hallyn [Thu, 6 Sep 2012 02:59:13 +0000 (21:59 -0500)]
lxc-destroy: Separately rm rootfs if it is a symlink

If rootfs is a symbolic link but not to a block device, then do a separate
rm of its contents.  We have to do this because, out of cowardice, we call
rm with --one-filesystem.

Removing the '-o -h $rootdev' is ok, because if $rootdev is a symbolic
link to a block device (including lvm blockdev) then -b will still return
true.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agoubuntu-cloud template cleanups
Scott Moser [Tue, 4 Sep 2012 20:44:25 +0000 (15:44 -0500)]
ubuntu-cloud template cleanups

Fix for quantal images which do not have the user 'ubuntu' present.
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/1045955

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agoadd prototype for clone(2) as per manpage
Serge Hallyn [Tue, 4 Sep 2012 19:06:29 +0000 (14:06 -0500)]
add prototype for clone(2) as per manpage

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agoAdd missing include for apparmor.h in conf.c
Stéphane Graber [Sun, 2 Sep 2012 00:15:31 +0000 (20:15 -0400)]
Add missing include for apparmor.h in conf.c

This include is conditional on apparmor being selected.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agoVarious fedora template improvements
Stéphane Graber [Fri, 31 Aug 2012 16:17:38 +0000 (09:17 -0700)]
Various fedora template improvements

1. don't add network segment to config
2. check for 'curl'
3. don't add $name to $path, it's already in there
4. don't add devpts to fstab, that's wrong.
5. $UTSNAME doesn't exist
6. set root pwd to root instead of rooter.
7. install fedora-release package.
8. add a console on /dev/console.
9. create empty fstab
10. don't mount devpts in rc.sysinit.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agosshd: run dhclient; allow adding a root ssh key
Stéphane Graber [Fri, 31 Aug 2012 16:09:34 +0000 (09:09 -0700)]
sshd: run dhclient; allow adding a root ssh key

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agoMake lxc-execute without rootfs work.
Stéphane Graber [Fri, 31 Aug 2012 15:58:56 +0000 (08:58 -0700)]
Make lxc-execute without rootfs work.

That means, don't try to pin a null rootfs, and don't try to mount /proc
since /var/lib/lxc/root/proc doesn't exist to be mounted onto.
The apparmor patches are not yet upstream, so this patch will not go
upstream by itself.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agolxc-ubuntu-cloud: get full pathname to userdata file
Serge Hallyn [Thu, 30 Aug 2012 16:02:24 +0000 (11:02 -0500)]
lxc-ubuntu-cloud: get full pathname to userdata file

When passing '--userdata somefile' to the ubuntu-cloud template, a user
may pass a relative pathname.  The template uses the filename after
changing current directory, so store the full pathname for the userdata
file instead of a potential relative pathname.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agoWhen creating the lxc cgroup directory, ignore -EEXIST
Stéphane Graber [Wed, 29 Aug 2012 21:42:59 +0000 (14:42 -0700)]
When creating the lxc cgroup directory, ignore -EEXIST

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com
11 years agoAdd lxc.aa_profile example to all templates
Stéphane Graber [Wed, 29 Aug 2012 16:27:53 +0000 (09:27 -0700)]
Add lxc.aa_profile example to all templates

LXC has optional apparmor support, default profile is lxc-container-default.
This change adds a commented "lxc.aa_profile = default" line to all templates,
uncommenting this will bypass apparmor for the container.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agoDon't update the host-name field in dhclient.conf when not hardcoded.
Stéphane Graber [Wed, 29 Aug 2012 20:51:37 +0000 (13:51 -0700)]
Don't update the host-name field in dhclient.conf when not hardcoded.

On Debian and Ubuntu, the default host-name field in dhclient.conf is
set to either "<hostname>" or "gethostname()" both of which get replaced
by the machine's hostname at query time.

The sed call currently present in lxc-clone hardcodes the hostname in
dhclient.conf, causing dpkg to prompt on isc-dhcp updates.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agoUse lxc_putold as the pivot_root put dir in the ubuntu templates
Stéphane Graber [Tue, 28 Aug 2012 17:46:59 +0000 (13:46 -0400)]
Use lxc_putold as the pivot_root put dir in the ubuntu templates

By default we use mnt, but that means that lxc fstab entries do not work
when placed under the container's /mnt/.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agoFix lxc-ubuntu and lxc-ubuntu-cloud to properly deal with /dev/shm.
Stéphane Graber [Tue, 28 Aug 2012 17:42:27 +0000 (13:42 -0400)]
Fix lxc-ubuntu and lxc-ubuntu-cloud to properly deal with /dev/shm.

Now that initscripts in Debian and Ubuntu has been updated to no longer
do silly things with /dev/shm and /run/shm on installation/update, the
check needs updating to detect any remaining broken case and fix it.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agolxc_start: exit early if insufficient privs in daemon mode
Serge Hallyn [Tue, 21 Aug 2012 15:05:19 +0000 (10:05 -0500)]
lxc_start: exit early if insufficient privs in daemon mode

Starting a container with insufficient privilege (correctly) fails
during lxc_init.  However, if starting a daemonized container, we
daemonize before we get to that check.  Therefore while the
container will fail to start, and the logfile will show this, the
'lxc-start -n x -d' command will return success.  For ease of
scripting, do a check for the required privilege before we exit.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agoubuntu template: apt-get clean after debootstrapping a cache
Serge Hallyn [Tue, 21 Aug 2012 14:59:43 +0000 (09:59 -0500)]
ubuntu template: apt-get clean after debootstrapping a cache

This saves quite a bit of space in the cache and containers.

See https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/1037626 for the
original bug report.

Reported-by: Fajar A. Nugraha <list@fajar.net>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agoubuntu and debian templates: Clean up cache if cache build is interrupted
Serge Hallyn [Tue, 21 Aug 2012 14:56:03 +0000 (09:56 -0500)]
ubuntu and debian templates: Clean up cache if cache build is interrupted

Otherwise the next lxc-create may rsync a bad cache.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agoCleanup partial container if -h was passed to template
Serge Hallyn [Fri, 17 Aug 2012 02:11:50 +0000 (21:11 -0500)]
Cleanup partial container if -h was passed to template

If user calls 'lxc-create -t ubuntu -- -h' (as opposed to
'lxc-create -t ubuntu -h') then the ubuntu template will print its
help then exit 0.  Then lxc-create does not cleanup.  So detect this
in lxc-create.

11 years agolxc-clone: fix handling of lxc.mount entries
Serge Hallyn [Fri, 20 Jul 2012 15:38:15 +0000 (10:38 -0500)]
lxc-clone: fix handling of lxc.mount entries

The 'lxc.mount =' entry can have more than one space, or tabs, before the =.
We only need to disambiguate from 'lxc.mount.entry'.  So just check for a
space or tab after mount.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agolxc-clone: change uuid on xfs
Serge Hallyn [Thu, 19 Jul 2012 22:54:54 +0000 (17:54 -0500)]
lxc-clone: change uuid on xfs

Otherwise after cloning an lvm+xfs container you can't run the
original and clone at the same time.

Based on a patch by Maurizio Sambati posted at
https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/1013549

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agoremove unused lastcap variable
Serge Hallyn [Tue, 31 Jul 2012 14:07:18 +0000 (16:07 +0200)]
remove unused lastcap variable

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agoFix lxc's handling of CAP_LAST_CAP
Serge Hallyn [Tue, 31 Jul 2012 14:07:18 +0000 (16:07 +0200)]
Fix lxc's handling of CAP_LAST_CAP

CAP_LAST_CAP in linux/capability.h doesn't always match what the kernel
actually supports.  If the kernel supports fewer capabilities, then a
cap_get_flag for an unsupported capability returns -EINVAL.

Recognize that, and don't fail when initializing capabilities when this
happens, rather accept that we've reached the last capability.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agoapparmor support: fix compilation with --disable-apparmor
Serge Hallyn [Tue, 31 Jul 2012 14:07:18 +0000 (16:07 +0200)]
apparmor support: fix compilation with --disable-apparmor

Make the prototypes and functions match between apparmor.{c,h}

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agolxc-ubuntu: Use dpkg --add-architecture
Serge Hallyn [Tue, 31 Jul 2012 14:07:18 +0000 (16:07 +0200)]
lxc-ubuntu: Use dpkg --add-architecture

When a container has dpkg >= 1.16.2, use dpkg --add-architecture
for multi-arch configuration on foreign architecture containers.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agotemplates: don't fail on busy flock
Serge Hallyn [Tue, 31 Jul 2012 14:07:18 +0000 (16:07 +0200)]
templates: don't fail on busy flock

Just wait until the lock is available.  That is a nicer behavior
for concurrent lxc-creates.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agolxc-ls: prepend container name with -- when calling ls
Serge Hallyn [Tue, 31 Jul 2012 14:07:18 +0000 (16:07 +0200)]
lxc-ls: prepend container name with -- when calling ls

Otherwise a container name with a dash confuses ls

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agolxc-unshare: require an argument
Serge Hallyn [Tue, 31 Jul 2012 14:07:18 +0000 (16:07 +0200)]
lxc-unshare: require an argument

It segfaults otherwise trying to execute &NULL.

We could alternatively guess at a command to execute, such as a
shell, but invariably there would be cases where the command we
guess does not exist.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agouse lxc_putold as pivot_dir put dir, not mnt
Serge Hallyn [Tue, 31 Jul 2012 14:07:18 +0000 (16:07 +0200)]
use lxc_putold as pivot_dir put dir, not mnt

Using mnt means that lxc fstab entries do not work when placed under
the container's /mnt/ (i.e. /mnt/etc).

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agolxc-ubuntu.in: drop duplicate code
Serge Hallyn [Tue, 31 Jul 2012 14:07:18 +0000 (16:07 +0200)]
lxc-ubuntu.in: drop duplicate code

Commits 15da01b3938d7ba45472e6c9d3b183a94dd86ca9 and
2e44ed1e647d9fd1544b7ad855bda22ca71abd12 conflicted and resulted in
some duplicate functionality.  Drop the poorer version of that block.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agoSimplify the Ubuntu template a bit
Serge Hallyn [Tue, 31 Jul 2012 14:07:18 +0000 (16:07 +0200)]
Simplify the Ubuntu template a bit

     - Update list of extra packages for debootstrap to only include vim
       and ssh. The others were only relevant when we were still using the
       minbase variant. (LP: #996839)
     - Drop any hardcoded Ubuntu version check and replace by feature
       checks instead.
     - Format lxc-ubuntu to consistently use 4-spaces indent instead of
       mixed spaces/tabs.
     - Update default /etc/network/interfaces to include the header.
     - Update default /etc/hosts to match that of a regular Ubuntu system.
     - Drop support for end-of-life releases (gutsy on sparc).
     - Make sure /etc/resolv.conf is valid before running any apt command.
     - Update template help message for release and arch parameters.
     - Switch default Ubuntu version from lucid to precise.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agolxc-ubuntu: fix non-native architectures
Serge Hallyn [Tue, 31 Jul 2012 14:04:33 +0000 (16:04 +0200)]
lxc-ubuntu: fix non-native architectures

When installing a non-native architecture, the template
installs a bunch of packages of the native architecture to work around
existing limitations of qemu-user-static, mostly related to netlink.

The current code would install upstart of the host architecture but
force the amd64 version of the others. This was just a mistake done
while testing/developping the code. Fixing now to always install
the native architecture version of all of them.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agoubuntu templates: remove maverick as it is end-of-life
Serge Hallyn [Tue, 31 Jul 2012 14:04:33 +0000 (16:04 +0200)]
ubuntu templates: remove maverick as it is end-of-life

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agoUpdate Ubuntu templates for quantal
Serge Hallyn [Tue, 31 Jul 2012 14:04:33 +0000 (16:04 +0200)]
Update Ubuntu templates for quantal

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agolxc-clone.in: put $line in quotes to avoid its expansion
Serge Hallyn [Tue, 31 Jul 2012 14:04:33 +0000 (16:04 +0200)]
lxc-clone.in: put $line in quotes to avoid its expansion

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agodon't try to pin a null rootfs.
Serge Hallyn [Tue, 31 Jul 2012 14:04:33 +0000 (16:04 +0200)]
don't try to pin a null rootfs.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agoswitch all sprintfs which can overrun to snprintfs
Serge Hallyn [Tue, 31 Jul 2012 14:04:33 +0000 (16:04 +0200)]
switch all sprintfs which can overrun to snprintfs

and check return values

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agolxc-execute: find lxc-init
Serge Hallyn [Tue, 31 Jul 2012 14:04:33 +0000 (16:04 +0200)]
lxc-execute: find lxc-init

lxc-init used to be under /usr/lib/lxc.  Now it is under
/usr/lib/<multiarch>/lxc, but old containers will still have it under
/usr/lib/lxc.  So search for a valid lxc-init to run.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agolxc-destroy: wait until the container is stopped
Serge Hallyn [Tue, 31 Jul 2012 14:04:33 +0000 (16:04 +0200)]
lxc-destroy: wait until the container is stopped

Signed-off-by: Timothy Chen <tnachen@gmail.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agomake lxc-shutdown -h work
Serge Hallyn [Tue, 31 Jul 2012 14:04:33 +0000 (16:04 +0200)]
make lxc-shutdown -h work

It was calling non-existent 'help'

Signed-off-by: Timothy Chen <tnachen@gmail.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agolxc-ubuntu-cloud: extract the right filenames from tarball
Serge Hallyn [Tue, 31 Jul 2012 14:04:33 +0000 (16:04 +0200)]
lxc-ubuntu-cloud: extract the right filenames from tarball

Signed-off-by: Ben Howard <ben.howard@canonical.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agolxc-ubuntu*: in precise, make /dev/shm a symbolic link to /run/shm
Serge Hallyn [Tue, 31 Jul 2012 14:04:33 +0000 (16:04 +0200)]
lxc-ubuntu*: in precise, make /dev/shm a symbolic link to /run/shm

This would be done (though done wrongly) by mounted-dev.conf, but
that doesn't run because we don't mount /dev.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agoDescription: Fix handling of user-data in ubuntu-cloud template
Serge Hallyn [Tue, 31 Jul 2012 14:04:33 +0000 (16:04 +0200)]
Description: Fix handling of user-data in ubuntu-cloud template

Signed-off-by: Ben Howard <ben.howard@canonical.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agoMinor lxc config template layout fix
Serge Hallyn [Tue, 31 Jul 2012 14:04:33 +0000 (16:04 +0200)]
Minor lxc config template layout fix

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agofix typo in confile.c
Serge Hallyn [Tue, 31 Jul 2012 14:04:33 +0000 (16:04 +0200)]
fix typo in confile.c

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Reported-by: Stéphane Graber <stgraber@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agolxc-ubuntu: use relative path as target for bind mount
Serge Hallyn [Tue, 31 Jul 2012 14:04:33 +0000 (16:04 +0200)]
lxc-ubuntu: use relative path as target for bind mount

An absolute path will be interpreted as absolute with respect to the
parent's namespace.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agotemplates: use relative paths when creating containers
Serge Hallyn [Tue, 31 Jul 2012 14:04:33 +0000 (16:04 +0200)]
templates: use relative paths when creating containers

At the same time, allow lxc.mount.entry to specify an absolute target
path relative to /var/lib/lxc/CN/rootfs, even if rootfs is a blockdev.
Otherwise all such entries are ignored for blockdev-backed containers.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agoIntroduce a first set of container hooks
Serge Hallyn [Tue, 31 Jul 2012 14:04:33 +0000 (16:04 +0200)]
Introduce a first set of container hooks

This patch introduces support for 4 hooks.  We'd like to have 6 in
all to mirror the openvz ones (thanks to Stéphane for this info):

pre-start: in the host namespace before container mounting happens
mount: after container mounting (as per config and /var/lib/lxc/container/fstab)
       but before pivot_root
start: immediately before exec'ing init
stop: in container namespace and in chroot before shutdown
umount: after other unmounting has happened
post-stop: outside of the container

stop and umount are not implemented here because when the kernel kills
the container init, it kills the namespace.  We can probably work around
this, i.e. by keeping the /proc/pid/ns/mnt open, and using that, though
all container tasks including init would still be dead.  Is that worth
pursuing?

start also presents a bit of an issue.  openvz allows a script on the
host to be specified, apparently.  My patch requires the script or
program to exist in the container.  I'm fine with trying to do it the
openvz way, but I wasn't sure what the best way to do that was.  Openvz
(I'm told) opens the script and passes its contents to a bash in the
container.  But that limits the hooks to being only scripts.  By
requiring the hook to be in the container, we can allow any sort of
hook, and assume that any required libraries/dependencies exist
there.

Other than that with this patchset I can add

lxc.hook.pre-start = /var/lib/lxc/p1/pre-start
lxc.hook.mount = /var/lib/lxc/p1/mount
lxc.hook.start = /start
lxc.hook.post-stop = /var/lib/lxc/p1/post-stop

to my /var/lib/lxc/p1/config, and the hooks get executed as expected.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agoIntroduce apparmor support
Serge Hallyn [Tue, 31 Jul 2012 14:04:33 +0000 (16:04 +0200)]
Introduce apparmor support

This could be done as generic 'lsm_init()' and 'lsm_load()' functions,
however that would make it impossible to compile one package supporting
more than one lsm.  If we explicitly add the selinux, smack, and aa
hooks in the source, then one package can be built to support multiple
kernels.

The smack support should be pretty trivial, and probably very close
to the apparmor support.

The selinux support may require more, including labeling the passed-in
fds (consoles etc) and filesystems.

If someone on the list has the inclination and experience to add selinux
support, please let me know.  Otherwise, I'll do Smack and SELinux.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agoAdd lxc-shutdown script
Serge Hallyn [Tue, 31 Jul 2012 14:04:33 +0000 (16:04 +0200)]
Add lxc-shutdown script

It optionally waits (an optional timeout # of seconds) for the container to
be STOPPED.  If given -r, it reboots the container (and exits immediately).
I decided to add the timeout after all because it's harder to finagle into
an upstart post-stop script than a full bash script.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agolxc-ubuntu-cloud.in: re-enable use of daily cloud images
Serge Hallyn [Tue, 31 Jul 2012 14:04:33 +0000 (16:04 +0200)]
lxc-ubuntu-cloud.in: re-enable use of daily cloud images

There are two types of cloud images - released and daily ones.  We were
always using daily ones, instead of using released by default with an
option for daily.  Fix that.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agoDescription: fix handling of non-precise cloud image format
Serge Hallyn [Tue, 31 Jul 2012 14:04:33 +0000 (16:04 +0200)]
Description: fix handling of non-precise cloud image format

Also includes a fix for broken check for $debug

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agolxc-ubuntu.in: fix up the logic adding group for bound users
Serge Hallyn [Tue, 31 Jul 2012 14:03:30 +0000 (16:03 +0200)]
lxc-ubuntu.in: fix up the logic adding group for bound users

 1. 'getent group $user' assumes user's group is named $user.
 2. if 'getent group' returns error, just ignore the group in container
 3. (misc) while it happens to all work out fine anyway, don't do
    getent passwd $bindhome if $bindhome isn't defined.  (it will
    successfully return all password entries)

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agopin container's rootfs to prevent read-only remount
Serge Hallyn [Tue, 31 Jul 2012 14:03:30 +0000 (16:03 +0200)]
pin container's rootfs to prevent read-only remount

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agoubuntu template: if a user is bound in, don't define ubuntu user
Serge Hallyn [Tue, 31 Jul 2012 14:03:30 +0000 (16:03 +0200)]
ubuntu template: if a user is bound in, don't define ubuntu user

It might have a conflicting uid, and isn't needed.  Also put the bound user
into sudo group.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agolxc-clone: maintain size of lvm snapshot
Serge Hallyn [Tue, 31 Jul 2012 14:01:28 +0000 (16:01 +0200)]
lxc-clone: maintain size of lvm snapshot

When creating a container as lvm snapshot, use the original size unless
user explicitly overrides it.
It's all well and good to day "use lvextend if you run out of space", but
in the meantime applications may become corrupted...

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agoubuntu template: add sudo group and cleanup minor devttydir issue
Stéphane Graber [Tue, 31 Jul 2012 14:01:28 +0000 (16:01 +0200)]
ubuntu template: add sudo group and cleanup minor devttydir issue

Always add the user to the 'sudo' group as it's been around
since at least Ubuntu 10.04. In addition make the user part
of the admin group until 12.04 where it's been removed.
Also fix a minor layout issue with devttydir.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agoubuntu template: install bound user's shell
Serge Hallyn [Tue, 31 Jul 2012 14:01:28 +0000 (16:01 +0200)]
ubuntu template: install bound user's shell

If a host user is bound into the container (-b), make sure that his
shell is installed in the container.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agolxc-clone: update any hwaddrs
Serge Hallyn [Tue, 31 Jul 2012 14:01:28 +0000 (16:01 +0200)]
lxc-clone: update any hwaddrs

Since we are creating a new container it should not share a macaddr with
the original container.

Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/934256

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agolxc-busybox.in: check separately that /usr/lib64 exists
Serge Hallyn [Tue, 31 Jul 2012 14:01:28 +0000 (16:01 +0200)]
lxc-busybox.in: check separately that /usr/lib64 exists

It's possible for only one of /lib64 and /usr/lib64 to exist, so
adding both fstab entries can cause the busybox container to fail
to start.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agoubuntu template: handle /etc/resolv.conf being a symlink
Serge Hallyn [Tue, 31 Jul 2012 14:01:28 +0000 (16:01 +0200)]
ubuntu template: handle /etc/resolv.conf being a symlink

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agoubuntu template: set -e to return error on failures.
Serge Hallyn [Tue, 31 Jul 2012 14:01:28 +0000 (16:01 +0200)]
ubuntu template: set -e to return error on failures.

Otherwise callers can get bad containers without knowing it.

Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/922645

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agoOnly create rootfs directory where required
Daniel Baumann [Tue, 31 Jul 2012 14:01:27 +0000 (16:01 +0200)]
Only create rootfs directory where required

In general, lxc-create should not mess with this and leave it entirely
up to the templates to create it.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agoAllow escape prefix to escape itself
Ivan Vilata i Balaguer [Tue, 31 Jul 2012 14:01:27 +0000 (16:01 +0200)]
Allow escape prefix to escape itself

 (Closes: #659011).

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agoFix 'trap' in lxc-clone
Daniel Baumann [Thu, 28 Jun 2012 14:13:01 +0000 (09:13 -0500)]
Fix 'trap' in lxc-clone

Fix signal names in lxc-clone trap.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agoFix 'trap in lxc-create script
Daniel Baumann [Tue, 31 Jul 2012 14:01:25 +0000 (16:01 +0200)]
Fix 'trap in lxc-create script

Fix correct signal names in lxc-create trap (Closes: #655173).

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agofix netstat script with separator
Daniel Baumann [Tue, 31 Jul 2012 14:01:24 +0000 (16:01 +0200)]
fix netstat script with separator

Allow to use -- as seperator in lxc-netstat, otherwise -n from lxc-netstat
collides with netstats -n option (Closes: #641251).
[Serge Hallyn] update patch to (1) not demand argument for
 exec (breaks) and  (2) set $name not $lxc_name.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agoChange ipv4 addresses in the configuration examples
Daniel Baumann [Tue, 31 Jul 2012 14:01:22 +0000 (16:01 +0200)]
Change ipv4 addresses in the configuration examples

Use non-routed, private IPv4 address in documentation examples
(Closes: #571525).

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agoSimplify information message
Daniel Baumann [Tue, 31 Jul 2012 14:01:21 +0000 (16:01 +0200)]
Simplify information message

Keeping creation of new containers without previously existing configuration
non-interactive and trimm the warning message.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agoTrimming directories to use
Daniel Baumann [Thu, 28 Jun 2012 13:51:10 +0000 (08:51 -0500)]
Trimming directories to use

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
12 years agolxc-setcap/lxc-setuid: add autoconf expansion for $libexecdir
David Ward [Thu, 3 May 2012 22:50:15 +0000 (00:50 +0200)]
lxc-setcap/lxc-setuid: add autoconf expansion for $libexecdir

Support new default location for LXCINITDIR.

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
12 years agomake help consistent for other scripts
David Ward [Thu, 3 May 2012 22:50:15 +0000 (00:50 +0200)]
make help consistent for other scripts

Display help information in a consistent format.

Print error messages and help information to stderr. Prefix error
messages with the name of the script (for easier debugging as part
of larger scripts).

Allow help information to be printed as a non-root user.

Fix file mode for lxc-checkconfig.in.

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
12 years agorewrite lxc-ps
David Ward [Thu, 3 May 2012 22:50:15 +0000 (00:50 +0200)]
rewrite lxc-ps

Use bash instead of perl; eliminates final lxc dependency on perl
(beneficial for minimal operating system environments).

Modify the cgroup search to only use hierarchies that contain one
or more subsystems. When searching, if a hierarchy contains the
'ns' subsystem, do not append '/lxc' to the parent cgroup.

Maintain column spacing. Expand container name column as necessary.
Properly handle spaces in 'ps' output that are not field separators
(for example, try 'lxc-ps -o pid,args').

Fix file mode in repository.

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
12 years agorefresh lxc-netstat
David Ward [Thu, 3 May 2012 22:50:15 +0000 (00:50 +0200)]
refresh lxc-netstat

Modify the cgroup search to only use hierarchies that contain one
or more subsystems. When searching, if a hierarchy contains the
'ns' subsystem, do not append '/lxc' to the parent cgroup.

Change method of bind mounting /proc/<pid>/net onto /proc/net, to
avoid error "cannot mount block device /proc/<pid>/net read-only".

Check that user is root. Check that container name is specified
before calling 'exec'.

Update the help information.

Print error messages and help information to stderr.

Make indentation consistent.

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
12 years agorefresh lxc-ls
David Ward [Thu, 3 May 2012 22:50:15 +0000 (00:50 +0200)]
refresh lxc-ls

Add an '--active' option that lists active containers by searching
cgroups. (Otherwise, the directories in /var/lib/lxc are listed.)
Modify the cgroup search to only use hierarchies that contain one
or more subsystems. When searching, if a hierarchy contains the
'ns' subsystem, do not append '/lxc' to the parent cgroup.

Add a '--help' option that prints the command syntax.

Print error messages and help information to stderr.

Update the documentation.

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
12 years agocgroup: only touch hierarchies that are bound to subsystems
David Ward [Thu, 3 May 2012 22:50:15 +0000 (00:50 +0200)]
cgroup: only touch hierarchies that are bound to subsystems

Obtain a list of subsystems from /proc/cgroups, and ignore hierarchies
that are not bound to any of them (especially the 'systemd' hierarchy:
http://www.freedesktop.org/wiki/Software/systemd/PaxControlGroups ).

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
12 years agolxc-attach: unify code for attaching a pid to a cgroup
David Ward [Thu, 3 May 2012 22:50:15 +0000 (00:50 +0200)]
lxc-attach: unify code for attaching a pid to a cgroup

To attach a new pid to the cgroups for an existing container, we can use
the same method that we did when we started the container: iterate over
all the mounted cgroup hierarchies; find the cgroup that pid 1 is in for
each hierarchy; add 'lxc/<name>' to the end of it; then write the pid to
the 'tasks' file in that cgroup. (The only difference is that we do not
create the cgroup again.) Note that we follow exactly the same iteration
pattern to delete our cgroups when a container is shutdown.

There may be situations where additional cgroups hierarchies are mounted
after the container is started, or the cgroup for pid 1 gets reassigned.
But we currently don't handle any of these cases in the shutdown code or
anywhere else, so it doesn't make sense to try to handle these cases for
lxc-attach by itself. Aside from simplifying the code, this change makes
it easier to solve a different problem: ignoring hierarchies that are
not bound to any subsystems (like 'systemd').

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
12 years agocgroup: rearrange code blocks
David Ward [Thu, 3 May 2012 22:50:15 +0000 (00:50 +0200)]
cgroup: rearrange code blocks

Avoid nesting and improve readability.

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
12 years agolxc-cgroup: use correct terminology
David Ward [Thu, 3 May 2012 22:50:15 +0000 (00:50 +0200)]
lxc-cgroup: use correct terminology

lxc-cgroup gets or sets the value of a state object (such as
'cpuset.cpus'), not the value of a subsystem (which would be
just 'cpuset').

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
12 years agocgroup: additional fix for deprecated ns subsystem
David Ward [Thu, 3 May 2012 22:50:15 +0000 (00:50 +0200)]
cgroup: additional fix for deprecated ns subsystem

When a hierarchy contains the 'ns' subsystem, do not append '/lxc'
to the parent cgroup. Update surrounding comments for consistency.

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
12 years agoutmp: support non-rootfs configuration
David Ward [Thu, 3 May 2012 22:50:15 +0000 (00:50 +0200)]
utmp: support non-rootfs configuration

Having a rootfs is not a necessary condition for monitoring utmp, since
/var or /var/run can just be remounted inside the container instead. We
should rely on the other two conditions already in place to decide
whether to monitor the utmp file:

 - the container was started with 'lxc-start', which indicates that it
   has a real init process and is expected to write to a utmp file

 - support for CAP_SYS_BOOT was not found in the kernel, which would
   otherwise supersede utmp monitoring

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
12 years agoutmp: do not set conf->need_utmp_watch if CAP_SYS_BOOT is not found
David Ward [Thu, 3 May 2012 22:50:15 +0000 (00:50 +0200)]
utmp: do not set conf->need_utmp_watch if CAP_SYS_BOOT is not found

If CAP_SYS_BOOT is not found in the kernel, the existing value for
conf->need_utmp_watch should be left intact (which will be '1' for
containers started with 'lxc-start', or '0' for containers started
with 'lxc-execute').

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
12 years agolxc-attach: use execvp instead of execve
David Ward [Thu, 3 May 2012 22:50:15 +0000 (00:50 +0200)]
lxc-attach: use execvp instead of execve

execvp does not require specifying the full path to the executable
(e.g., "ls" instead of "/bin/ls"), making the operation of 'lxc-attach'
consistent with 'lxc-start' and 'lxc-execute'.

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
12 years agouse syscall numbers from Linux kernel headers
David Ward [Thu, 3 May 2012 22:50:15 +0000 (00:50 +0200)]
use syscall numbers from Linux kernel headers

__NR_setns is defined in the Linux kernel headers in linux/unistd.h.
The full Linux kernel sources are not necessary for compilation.

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
12 years agolxc-0.8.0-rc2
Daniel Lezcano [Tue, 20 Mar 2012 22:27:47 +0000 (23:27 +0100)]
lxc-0.8.0-rc2

12 years agoUpdate manpages to reflect some updated options.
Serge Hallyn [Sun, 18 Mar 2012 23:31:40 +0000 (00:31 +0100)]
Update manpages to reflect some updated options.

(which reminds me a lxc-clone manpage still needs to be written)

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
12 years agoubuntu templates cleanups
Serge Hallyn [Sun, 18 Mar 2012 23:31:40 +0000 (00:31 +0100)]
ubuntu templates cleanups

1. fix inconsistent use of '--auth-key' (not --auth_key) which broke their
   usage
2. add --debug option to lxc-ubuntu (which does set -x to show what broke)
   (idea from Idea from lifeless and benji)
3. fix incorrect assumption about group with -b option.  User's default group
   may not be the same as username.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
12 years agodo check for utmp checking at the right time
Serge Hallyn [Sun, 18 Mar 2012 23:31:40 +0000 (00:31 +0100)]
do check for utmp checking at the right time

We were doing the check for whether we need to watch utmp from a
thread cloned from that which will actually do the utmp watching.
As a result, the utmp file was always being watched, even if it
didn't need to be.

Move the check to the parent thread.

Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/948623

Signed-off-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
12 years agofix cached rootfs update* fix rootfs path* add handling of systemd
InformatiQ [Mon, 5 Mar 2012 22:53:14 +0000 (23:53 +0100)]
fix cached rootfs update* fix rootfs path* add handling of systemd

Signed-off-by: InformatiQ <rhanna@informatiq.org>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
12 years agocgroups: fix broken support for deprecated ns cgroup
Serge Hallyn [Mon, 5 Mar 2012 22:53:14 +0000 (23:53 +0100)]
cgroups: fix broken support for deprecated ns cgroup

when using ns cgroup, use /cgroup/<init-cgroup> rather than
/cgroup/<init-cgroup>/lxc

At least lxc-start, lxc-stop, lxc-cgroup, lxc-console and lxc-ls work
with this patch.  I've tested this in a 2.6.35 kernel with ns cgroup,
and in a 3.2 kernel without ns cgroup.

Note also that because of the check for container reboot support,
if we're using the ns cgroup we now end up with a /cgroup/<container>/2
cgroup created, empty, by the clone(CLONE_NEWPID).  I'm really not
sure how much time we want to spend cleaning such things up since
ns cgroup is deprecated in kernel.

Signed-off-by: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
12 years agolxc-0.8.0-rc1
Daniel Lezcano [Thu, 1 Mar 2012 23:03:18 +0000 (00:03 +0100)]
lxc-0.8.0-rc1

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
12 years agofix lxc-attach.sgml.in spurious variable list
Daniel Lezcano [Thu, 1 Mar 2012 23:02:42 +0000 (00:02 +0100)]
fix lxc-attach.sgml.in spurious variable list

Signed-off-by: Daniel Lezcano <daniel.lezcano@free.fr>
12 years agofix sparc architecture for autoconf
Daniel Lezcano [Sun, 26 Feb 2012 09:56:38 +0000 (10:56 +0100)]
fix sparc architecture for autoconf

Reported-by : Denny Schierz <linuxmail@4lin.net>
Signed-off-by: Daniel Lezcano <daniel.lezcano@free.fr>
12 years agoIf a container is already running, say so in error msgs.
Serge Hallyn [Wed, 22 Feb 2012 17:40:16 +0000 (11:40 -0600)]
If a container is already running, say so in error msgs.

Otherwise there is no clear indication to the user why the container
startup failed.

Signed-off-by: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>