]> git.proxmox.com Git - mirror_lxc.git/log
mirror_lxc.git
11 years agoIntroduce support for seccomp.
Serge Hallyn [Sat, 28 Jul 2012 02:13:53 +0000 (21:13 -0500)]
Introduce support for seccomp.

Hi,

This patch is so far just a proof of concept.  The libseccomp api will be
changing soon so it probably wouldn't be worth pulling this until it is
updated for the new API.

This patch introduces support for seccomp to lxc.  Seccomp lets a program
restrict its own (and its children's) future access to system calls.  It
uses a simple whitelist system call policy file.  It would probably be
better to switch to something more symbolic (i.e specifying 'open' rather
than the syscall #, especially given container arch flexibility).

I just wanted to get this out there as a first step.  You can also get
source for an ubuntu package based on this patch at
https://code.launchpad.net/~serge-hallyn/ubuntu/quantal/lxc/lxc-seccomp

Signed-off-by: Serge Hallyn <serge.hallyn@canonical.com>
11 years agolxc-wait: Add timeout option
Jan Kiszka [Thu, 9 Aug 2012 22:54:48 +0000 (17:54 -0500)]
lxc-wait: Add timeout option

Allow to specify a timeout for waiting on state changes via lxc-wait.
Helpful for scripts that need to handle errors or excessive delays in
state changing procedures.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agoVersion 0.8.0
Daniel Lezcano [Sun, 11 Nov 2012 02:34:22 +0000 (03:34 +0100)]
Version 0.8.0

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agofix git location
Daniel Lezcano [Sun, 11 Nov 2012 02:32:43 +0000 (03:32 +0100)]
fix git location

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agoclearer error message when interface name to long
Daniel Lezcano [Wed, 31 Oct 2012 16:15:25 +0000 (17:15 +0100)]
clearer error message when interface name to long

Signed-off-by: Tomas Pospisek <tpo_deb@sourcepole.ch>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agoFix lxc-netstat -- argument processing
Dwight Engen [Wed, 31 Oct 2012 16:08:13 +0000 (17:08 +0100)]
Fix lxc-netstat -- argument processing

Commit 21e487f2 introduced the use of getopt, but getopt will fail when
it sees arguments meant for netstat that are not in [short|long]options.
There should not be any ambiguity about arguments with the same letter:
those to the left of the -- are destined for lxc-netstat and those to
the right for the real netstat, which the original code handles by
shifting out all arguments it recognizes before the -- is hit.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agoFix lxc-ps -- argument processing
Dwight Engen [Thu, 25 Oct 2012 20:21:53 +0000 (16:21 -0400)]
Fix lxc-ps -- argument processing

lxc-ps is supposed to pass arguments after the -- on to ps. The problem is
that i is expanded once from $@ and the loop will iterate over all the
arguments that were in $@ at the time of expansion. Inside the loop, there
are shifts (in the name case for example) that are trying to remove more
than a single argument. This changes fixes that and makes lxc-ps work as
documented.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agoRemove unneeded ksrc spec file macro
Dwight Engen [Wed, 31 Oct 2012 16:08:13 +0000 (17:08 +0100)]
Remove unneeded ksrc spec file macro

Change 910bb4fa obviated the need for the --with-linuxdir configure
option which means that the ksrc rpm macro no longer makes sense either.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agoAdd %{dist} tag to differentiate RPM distributions and releases
Dwight Engen [Wed, 31 Oct 2012 16:08:13 +0000 (17:08 +0100)]
Add %{dist} tag to differentiate RPM distributions and releases

Note that an additional Release field is not necessary for the devel package
as it will follow the primary Release field. For more information on the dist
tag, see http://fedoraproject.org/wiki/Packaging:DistTag

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agoMerge branch 'upstream-bugfix' of https://github.com/lxc/lxc
Daniel Lezcano [Wed, 31 Oct 2012 15:39:50 +0000 (16:39 +0100)]
Merge branch 'upstream-bugfix' of https://github.com/lxc/lxc

* 'upstream-bugfix' of https://github.com/lxc/lxc: (47 commits)
  replace HOOK define with proper code.
  Remove lxc-start-ephemeral from configure.ac
  revert devtmpfs in ubuntu templates
  lxc-ubuntu{-cloud}: Fix missing "fi" in new devtmpfs code
  fix "make rpm"
  display warning when yum missing in fedora template
  templates: mount devtmpfs in ubuntu containers
  handle clone of btrfs snapshots
  if the rootfs is a btrfs subvolume, delete it instead of rm -rf
  lxc-debian: replace isc-dhcp-server by isc-dhcp-client
  lxc-ls: Scan cgroup mount points from fstype and not device
  Allow short -h and -n options to lxc-ps
  lxc-ubuntu: fix printing of default user
  lxc-debian: specify isc-dhcp-server in package list
  try to better handle out of date container caches.
  link /dev/kmsg to /dev/console in the container
  lxc-clone: fix the '--name' parameter
  lxc-ls: Use readlink on $directory
  lxc-busybox: Use relative mounts in lxc.mount.entry
  busybox: for all lib dirs create mounts only if directories exist
  ...

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
11 years agoreplace HOOK define with proper code.
Serge Hallyn [Tue, 4 Sep 2012 18:57:39 +0000 (13:57 -0500)]
replace HOOK define with proper code.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agoRemove lxc-start-ephemeral from configure.ac
Stéphane Graber [Thu, 25 Oct 2012 08:43:59 +0000 (10:43 +0200)]
Remove lxc-start-ephemeral from configure.ac

lxc-start-ephemeral.in ended up in configure.ac as a result of the
cherry-pick. This new tool hasn't been pulled in yet.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agorevert devtmpfs in ubuntu templates
Serge Hallyn [Wed, 24 Oct 2012 16:05:38 +0000 (11:05 -0500)]
revert devtmpfs in ubuntu templates

devtmpfs is shared between host and containers, and it messes up
lucid containers too.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agolxc-ubuntu{-cloud}: Fix missing "fi" in new devtmpfs code
Stéphane Graber [Wed, 24 Oct 2012 11:05:03 +0000 (13:05 +0200)]
lxc-ubuntu{-cloud}: Fix missing "fi" in new devtmpfs code

The "if" statement to add devtmpfs was missing a matching "fi" causing parsing
error when using the template.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agofix "make rpm"
Dwight Engen [Thu, 4 Oct 2012 16:28:38 +0000 (12:28 -0400)]
fix "make rpm"

RPM doesn't like "-" in the version number and gives:
"error: line 24: Illegal char '-' in: Version: 0.8.0-rc2"
Other packages (bind-utils for example) have used . instead
of - as a seperator.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agodisplay warning when yum missing in fedora template
Dwight Engen [Thu, 4 Oct 2012 17:12:41 +0000 (13:12 -0400)]
display warning when yum missing in fedora template

This early exit is preventing the warning message that follows it from
being shown.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
11 years agotemplates: mount devtmpfs in ubuntu containers
Serge Hallyn [Thu, 4 Oct 2012 18:54:00 +0000 (13:54 -0500)]
templates: mount devtmpfs in ubuntu containers

That way /dev/disk/ exists, and update-grub can succeed.

Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1060404

11 years agohandle clone of btrfs snapshots
Dwight Engen [Wed, 26 Sep 2012 17:20:30 +0000 (13:20 -0400)]
handle clone of btrfs snapshots

Fix determination of $oldroot from the config file. The old code had the '
in the wrong place and didn't account for whitespace between the = and
the rootfs.

Set $rootfs based on $oldroot instead of forcing it to be in
$lxc_path/$lxc_new/rootfs. This allows for btrfs snapshot to be made even if
$lxc_path isn't on the same filesystem. If $oldroot isn't a subvolume,
fall back to making a copy.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
11 years agoif the rootfs is a btrfs subvolume, delete it instead of rm -rf
Dwight Engen [Wed, 26 Sep 2012 16:59:28 +0000 (12:59 -0400)]
if the rootfs is a btrfs subvolume, delete it instead of rm -rf

Check if the rootfs is btrfs subvolume, and if so delete it. Otherwise
fall back to the rm -rf.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
11 years agolxc-debian: replace isc-dhcp-server by isc-dhcp-client
Stéphane Graber [Mon, 24 Sep 2012 19:16:25 +0000 (15:16 -0400)]
lxc-debian: replace isc-dhcp-server by isc-dhcp-client

The DHCP client should be isc-dhcp-client, not isc-dhcp-server.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agolxc-ls: Scan cgroup mount points from fstype and not device
Christian Seiler [Mon, 24 Sep 2012 09:21:48 +0000 (11:21 +0200)]
lxc-ls: Scan cgroup mount points from fstype and not device

lxc-ls --active now scans mount points that have the 'cgroup' filesystem
type and not the 'cgroup' device name (which is ignored anyway and may be
anything).

Signed-off-by: Christian Seiler <christian@iwakd.de>
Cc: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agoAllow short -h and -n options to lxc-ps
Dwight Engen [Tue, 18 Sep 2012 19:58:17 +0000 (15:58 -0400)]
Allow short -h and -n options to lxc-ps

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
11 years agolxc-ubuntu: fix printing of default user
Serge Hallyn [Wed, 19 Sep 2012 17:15:51 +0000 (12:15 -0500)]
lxc-ubuntu: fix printing of default user

If a user is bound into the container, don't claim the default user is
ubuntu.

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

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agolxc-debian: specify isc-dhcp-server in package list
Serge Hallyn [Wed, 19 Sep 2012 17:14:58 +0000 (12:14 -0500)]
lxc-debian: specify isc-dhcp-server in package list

dhcp3-client does not exist in testing.

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

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agotry to better handle out of date container caches.
Serge Hallyn [Fri, 14 Sep 2012 19:43:45 +0000 (14:43 -0500)]
try to better handle out of date container caches.

For a lucid container, apt-get update before installing the source package for
add-apt-repository, so that apt-get does not fail.

If apt-get dist-upgrade fails, suggest running lxc-create with -F.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agolink /dev/kmsg to /dev/console in the container
Serge Hallyn [Thu, 13 Sep 2012 14:39:07 +0000 (09:39 -0500)]
link /dev/kmsg to /dev/console in the container

This way init log messages can be seen on the console.  If containerized
syslog ever comes around, we can get rid of this.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agolxc-clone: fix the '--name' parameter
Serge Hallyn [Thu, 13 Sep 2012 14:38:11 +0000 (09:38 -0500)]
lxc-clone: fix the '--name' parameter

The long opt for --name was being incorrectly compared to --new.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agolxc-ls: Use readlink on $directory
Stéphane Graber [Wed, 12 Sep 2012 22:21:00 +0000 (18:21 -0400)]
lxc-ls: Use readlink on $directory

lxc-ls was failing in cases where $directory is a symlink to another
directory. Instead have $directory be generated from the output of
readlink -f "$lxc_path".

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agolxc-busybox: Use relative mounts in lxc.mount.entry
Stéphane Graber [Wed, 12 Sep 2012 19:22:15 +0000 (15:22 -0400)]
lxc-busybox: Use relative mounts in lxc.mount.entry

To make it easier to clone/rename the container, replace hardcoded
entries (with rootfs in the destination path) by rootfs-relative entries.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agobusybox: for all lib dirs create mounts only if directories exist
Stuart Yoder [Wed, 12 Sep 2012 18:15:12 +0000 (13:15 -0500)]
busybox: for all lib dirs create mounts only if directories exist

Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com>
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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>