1. 29 Jan, 2015 4 commits
    • clone_paths: use 'rootfs' for destination directory · 730e3f9e
      Serge Hallyn authored
      We were trying to be smart and use whatever the last part of
      the container's rootfs path was.  However for block devices
      that doesn't make much sense.  I.e. if lxc.rootfs = /dev/md-1,
      chances are that /var/lib/lxc/c1/md-1 does not exist.
      
      So always use the $lxcpath/$lxcname/rootfs, and if it does
      not exist, try to create it.
      
      With this, 'lxc-clone -s -o c1 -n c2' where c1 has an lvm backend
      is fixed.  See https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/1414771Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com>
      Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
    • create lxc.tty ptys from container process · e8bd4e43
      Serge Hallyn authored
      Lxc has always created the ptys for use by console and ttys early
      on from the monitor process.  This has some advantages, but also
      has disadvantages, namely (1) container ptys counting against the
      max ptys for the host, and (2) not having a /dev/pts/N in the
      container to pass to getty.  (2) was not a problem for us historically
      because we bind-mounted the host's /dev/pts/N onto a /dev/ttyN in
      the container.  However, systemd hardocdes a check for container_ttys
      that the path have 'pts/' in it.  If it were only for (2) I'd have
      opted for a systemd patch to check the device major number, but (1)
      made it worth moving the openpty to the container namespace.
      
      So this patch moves the tty creation into the task which becomes
      the container init.  It then passes the fds for the opened ptys
      back to the monitor over a unix socketpair (for use by lxc-console).
      The /dev/console is still created in the monitor process, so that
      it can for instance be used by lxc.logfd.
      
      So now if you have a foreground container with lxc.tty = 4, you
      should end up with one host /dev/pts entry per container rather than 5.
      
      And lxc-console now works with systemd containers.
      
      Note that if the container init mounts its own devpts over the
      one mounted by lxc, the tty /dev/pts/n will be hidden.  This is ok
      since it's only systemd that needs it, and systemd won't do that.
      Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com>
      Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
    • Use consistent /proc, /sys and /sys/fs/cgroup (v2) · f24a52d5
      Stéphane Graber authored
       - Implements mixed mode for /sys where it's mounted read-only but with
         /sys/devices/virtual/net/ writable.
      
       - Sets lxc.mount.auto to "cgroup:mixed proc:mixed sys:mixed" for all
         templates.
      
       - Drop any template-specific mount for /proc, /sys or /sys/fs/cgroup.
      
       - Get rid of the fstab file by default, using lxc.mount.entry instead.
      
       - Set sys:mixed as the default for "sys". sys:mixed is slightly more
         permissive than sys:ro so this shouldn't be a problem.
      
      The read-only bind mount of /sys on top of itself is there so that
      mountall and other init systems don't attempt to remount /sys
      read-write.
      
      v2 changes:
       - Fix the mount list, don't specify a source for the remount.
       - Update the documentation.
      Signed-off-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
      Acked-by: 's avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>
  2. 28 Jan, 2015 6 commits
  3. 27 Jan, 2015 5 commits
  4. 26 Jan, 2015 3 commits
  5. 25 Jan, 2015 4 commits
  6. 24 Jan, 2015 6 commits
  7. 22 Jan, 2015 2 commits
  8. 21 Jan, 2015 6 commits
    • add "--mask-tmp" to lxc-fedora, plus some template script fixes] · c2af3084
      Michael Adam authored
      Hi Michael,
      
      do you have any concerns with the attached patch to
      the fedora template that adds an option --mask-tmp
      that prevents fedora/systemd from over-mounting
      /tmp with tmpfs, which is useful in some cases?
      
      Thanks - Michael
      
      ----- Forwarded message from Michael Adam <obnox@samba.org> -----
      
      Date: Sat, 10 Jan 2015 13:12:06 +0100
      From: Michael Adam <obnox@samba.org>
      To: LXC development mailing-list <lxc-devel@lists.linuxcontainers.org>
      Subject: Re: [lxc-devel] [PATCHES] add "--mask-tmp" to lxc-fedora, plus some
      	template script fixes
      User-Agent: Mutt/1.5.23 (2014-03-12)
      
      On 2015-01-10 at 13:08 +0100, Michael Adam wrote:
      > On 2015-01-10 at 04:05 +0000, Serge Hallyn wrote:
      >
      > > The less controversial one is adding mask-tmp to the fedora template.
      > > It looks fine to me, but that should go separately to mwarfield, our
      > > fedora template maintainer :)
      >
      > I had notified mhw of my patches on irc, but apparently he is
      > currently very busy.
      >
      > For a start, following is an update of the uncontroversial fix
      > patches, i.e. the fix patche without the path ones, and without
      > the mask-tmp patch.
      
      And here comes the mask-tmp patch.
      It needs to be applied onto the previous fix-patchset.
      
      From 9589dca113535ed2f4faad89db2fab33bb8a9d7e Mon Sep 17 00:00:00 2001
      From: Michael Adam <obnox@samba.org>
      Date: Thu, 8 Jan 2015 10:25:24 +0100
      Subject: [PATCH] lxc-fedora: add a new option --mask-tmp
      
      This will configure the container to prevent the standard
      behaviour of over-mounting /tmp with tmpfs, which can be
      undesirable in some cases.
      
      My personal use case is vagrant-lxc in combination with
      vagrant-cachier.
      Signed-off-by: 's avatarMichael Adam <obnox@samba.org>
      Acked-by: 's avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>
    • Merge pull request #397 from axn/master · 6b1aa947
      hallyn authored
      Fix instantiation of multiple vlan interfaces with same id
    • Add common.conf.d · 4662c6de
      Stéphane Graber authored
      Signed-off-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
      Acked-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com>
    • Set kmsg to 0 by default · d89de239
      Stéphane Graber authored
      It's now been proven over and over again that the symlink from /dev/kmsg
      to /dev/console is harmful for everything but upstart systems. As Ubuntu
      is now switching over to systemd too, lets switch the default.
      
      Upstart users wishing to see boot messages can always set lxc.kmsg = 1
      manually in their config (so long as they don't expect to then
      dist-upgrade the container to systemd succesfuly).
      Signed-off-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
      Acked-by: 's avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>
    • Turn autodev on by default · 124fa0a8
      Stéphane Graber authored
      Now that autodev works fine with unprivileged containers and shouldn't
      come with any side effect, lets turn it on by default.
      Signed-off-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
      Acked-by: 's avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>
  9. 20 Jan, 2015 3 commits
  10. 19 Jan, 2015 1 commit