mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-15 10:12:24 +00:00
Fix previous commit, removing hardcoded /var/lib/lxc from lxc-start-ephemeral
The previous commit was missing part of the changes, leading to a non-working version of lxc-start-ephemeral. This commit adds the missing parts. Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
This commit is contained in:
parent
caf32f58cd
commit
95a717e9b9
@ -143,6 +143,7 @@ AC_CHECK_DECLS([PR_CAPBSET_DROP], [], [], [#include <sys/prctl.h>])
|
||||
AC_CHECK_HEADERS([sys/signalfd.h])
|
||||
|
||||
AC_PROG_GCC_TRADITIONAL
|
||||
AC_PROG_SED
|
||||
|
||||
if test "x$GCC" = "xyes"; then
|
||||
CFLAGS="$CFLAGS -Wall"
|
||||
|
@ -144,6 +144,10 @@ lxc_unshare_SOURCES = lxc_unshare.c
|
||||
lxc_wait_SOURCES = lxc_wait.c
|
||||
lxc_kill_SOURCES = lxc_kill.c
|
||||
|
||||
lxc-start-ephemeral: lxc-start-ephemeral.in
|
||||
[ -f $@ ] && rm -f $@ || true
|
||||
$(SED) -e "s:[@]LXCPATH@:$(LXCPATH):" $< > $@
|
||||
|
||||
install-exec-local: install-soPROGRAMS
|
||||
mv $(DESTDIR)$(libdir)/liblxc.so $(DESTDIR)$(libdir)/liblxc.so.$(VERSION)
|
||||
/sbin/ldconfig -l $(DESTDIR)$(libdir)/liblxc.so.$(VERSION)
|
||||
|
@ -109,7 +109,7 @@ if not orig.defined:
|
||||
sys.exit(1)
|
||||
|
||||
# Create the new container paths
|
||||
dest_path = tempfile.mkdtemp(prefix="%s-" % args.orig, dir="/var/lib/lxc/")
|
||||
dest_path = tempfile.mkdtemp(prefix="%s-" % args.orig, dir="@LXCPATH@")
|
||||
os.mkdir(os.path.join(dest_path, "rootfs"))
|
||||
|
||||
# Setup the new container's configuration
|
||||
@ -217,8 +217,8 @@ if not args.keep_data:
|
||||
with open(os.path.join(dest_path, "post-stop"), "w+") as fd:
|
||||
os.fchmod(fd.fileno(), 0o755)
|
||||
fd.write("""#!/bin/sh
|
||||
[ -n "$1" ] && [ -d "/var/lib/lxc/$1/" ] && rm -Rf /var/lib/lxc/$1/
|
||||
""")
|
||||
[ -d "%s" ] && rm -Rf "%s"
|
||||
""" % (dest.get_config_item("lxc.rootfs"), dest.get_config_item("lxc.rootfs"))
|
||||
|
||||
dest.set_config_item("lxc.hook.post-stop",
|
||||
os.path.join(dest_path, "post-stop"))
|
||||
|
Loading…
Reference in New Issue
Block a user