]> git.proxmox.com Git - mirror_lxc.git/commitdiff
c/r: put lxc-restore-net in /usr/share
authorTycho Andersen <tycho.andersen@canonical.com>
Wed, 22 Oct 2014 22:25:02 +0000 (22:25 +0000)
committerStéphane Graber <stgraber@ubuntu.com>
Mon, 27 Oct 2014 15:31:38 +0000 (11:31 -0400)
On restore, we pass criu a script to manage the network interfaces (i.e. the
full path to lxc-restore-net), which we previously installed into
/var/lib/<tuple>/lxc. However, this is also the directory that is the default
for use in mounting the rootfs locally before pivot_root()ing. So, we mounted
the rootfs and then happliy called criu, pointing it to this directory which
didn't have lxc-restore-net any more, it just had the container's rootfs.
Instead, we should put lxc-restore-net somewhere else, so that criu can still
see it after the rootfs is mounted.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
configure.ac
src/lxc/Makefile.am
src/lxc/lxccontainer.c

index 806b4ff7f9431254fe2108e4d4c68cc861d863cf..5f9774b641aad466f4bff7fef2accab9207b74bb 100644 (file)
@@ -533,6 +533,9 @@ AS_AC_EXPAND(LOGPATH, "$with_log_path")
 AS_AC_EXPAND(RUNTIME_PATH, "$with_runtime_path")
 AC_SUBST(DEFAULT_CGROUP_PATTERN, ["$with_cgroup_pattern"])
 
+# We need the install path so criu knows where to reference the hook scripts.
+AC_DEFINE_UNQUOTED([DATADIR], "$DATADIR", ["Prefix for shared files."])
+
 # Check for some standard kernel headers
 AC_CHECK_HEADERS([linux/unistd.h linux/netlink.h linux/genetlink.h],
                                [],
index 840e1c7c5df9fe2dc81ae83fea373bfbbb91363b..b1e56b939994e1753bc730a58bcc5dc37696ac94 100644 (file)
@@ -202,8 +202,6 @@ sbin_PROGRAMS = init.lxc
 pkglibexec_PROGRAMS = \
        lxc-monitord \
        lxc-user-nic
-pkglibexec_SCRIPTS = \
-       lxc-restore-net
 
 AM_LDFLAGS = -Wl,-E
 if ENABLE_RPATH
@@ -263,5 +261,8 @@ install-exec-local: install-soPROGRAMS
 install-exec-hook:
        chmod u+s $(DESTDIR)$(libexecdir)/lxc/lxc-user-nic
 
+install-data-local:
+       install -c -m 755 lxc-restore-net $(DESTDIR)$(datadir)/lxc
+
 uninstall-local:
        $(RM) $(DESTDIR)$(libdir)/liblxc.so*
index d5ac37830e9159c137c1d0fd0abf4c9ccb65e635..2372b197f8770d541c3ffa2451b2a0f4eacb1ba4 100644 (file)
@@ -3604,7 +3604,7 @@ static void exec_criu(struct criu_opts *opts)
        DECLARE_ARG("--force-irmap");
        DECLARE_ARG("--manage-cgroups");
        DECLARE_ARG("--action-script");
-       DECLARE_ARG(LIBEXECDIR "/lxc/lxc-restore-net");
+       DECLARE_ARG(DATADIR "/lxc/lxc-restore-net");
        DECLARE_ARG("-D");
        DECLARE_ARG(opts->directory);
        DECLARE_ARG("-o");