1. 17 Nov, 2016 30 commits
  2. 12 Nov, 2015 1 commit
  3. 10 Nov, 2015 1 commit
  4. 09 Nov, 2015 1 commit
  5. 06 Nov, 2015 7 commits
    • arch template: Fix systemd-sysctl service · 60507848
      Jakub Sztandera authored
      The systemd-sysctl service includes condition that /proc/sys/ has to be read-write.
      In lxc only /proc/sys/net/ is read-write which causes the condition to fail and service not to run.
      This patch changes the check to /proc/sys/net/ and makes the service apply only rules that are in net tree.
      Signed-off-by: 's avatarJakub Sztandera <kubuxu@gmail.com>
    • Simplify function · 752b36f5
      Christian Brauner authored
      Instead of duplicating the cleanup-code, once for success and once for failure,
      simply keep a variable fret which is -1 in the beginning and gets set to 0 on
      success or stays -1 on failure.
      Signed-off-by: 's avatarChristian Brauner <christianvanbrauner@gmail.com>
      Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
    • Parse rootfs->path · 5e2c13c0
      Christian Brauner authored
      The mount_entry_overlay_dirs() and mount_entry_aufs_dirs() functions create
      workdirs and upperdirs for overlay and aufs lxc.mount.entry entries. They try
      to make sure that the workdirs and upperdirs can only be created under the
      containerdir (e.g. /path/to/the/container/CONTAINERNAME). In order to do this
      the right hand side of
      
                      if ((strncmp(upperdir, lxcpath, dirlen) == 0) && (strncmp(upperdir, rootfs->path, rootfslen) != 0))
      
      was thought to check if the rootfs->path is not present in the workdir and
      upperdir mount options. But the current check is bogus since it will be
      trivially true whenever the container is a block-dev or overlay or aufs backed
      since the rootfs->path will then have a form like e.g.
      
              overlayfs:/some/path:/some/other/path
      
      This patch adds the function ovl_get_rootfs_dir() which parses rootfs->path by
      searching backwards for the first occurrence of the delimiter pair ":/". We do
      not simply search for ":" since it might be used in path names. If ":/" is not
      found we assume the container is directory backed and simply return
      strdup(rootfs->path).
      Signed-off-by: 's avatarChristian Brauner <christianvanbrauner@gmail.com>
      Acked-by: 's avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>
    • Ignore trailing /init.scope in init cgroups · a156301a
      Serge Hallyn authored
      The lxc monitor does not store the container's cgroups, rather it
      recalculates them whenever needed.
      
      Systemd moves itself into a /init.scope cgroup for the systemd
      controller.
      
      It might be worth changing that (by storing all cgroup info in the
      lxc_handler), but for now go the hacky route and chop off any
      trailing /init.scope.
      
      I definately thinkg we want to switch to storing as that will be
      more bullet-proof, but for now we need a quick backportable fix
      for systemd 226 guests.
      Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com>
      Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
    • Make mount_entry_create_*_dirs() more robust · 0e86d94a
      Christian Brauner authored
      The mount_entry_create_*_dirs() functions currently assume that the rootfs of
      the container is actually named "rootfs". This has the consequence that
      
      	del = strstr(lxcpath, "/rootfs");
      	if (!del) {
      		free(lxcpath);
      		lxc_free_array((void **)opts, free);
      		return -1;
      	}
      	*del = '\0';
      
      will return NULL when the rootfs of a container is not actually named "rootfs".
      This means the we return -1 and do not create the necessary upperdir/workdir
      directories required for the overlay/aufs mount to work. Hence, let's not make
      that assumption. We now pass lxc_path and lxc_name to
      mount_entry_create_*_dirs() and create the path directly. To prevent failure we
      also have mount_entry_create_*_dirs() check that lxc_name and lxc_path are not
      empty when they are passed in.
      Signed-off-by: 's avatarChristian Brauner <christianvanbrauner@gmail.com>
      Acked-by: 's avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>
    • Init error_num to 1 · 56191985
      Stéphane Graber authored
      Signed-off-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
      Acked-by: 's avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>