mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-07-12 19:41:27 +00:00
lxc-start-ephemeral: Also set xino path
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
This commit is contained in:
parent
9009a72899
commit
cd80249bbd
@ -48,6 +48,20 @@ def randomMAC():
|
|||||||
random.randint(0x00, 0xff)]
|
random.randint(0x00, 0xff)]
|
||||||
return ':'.join(map(lambda x: "%02x" % x, mac))
|
return ':'.join(map(lambda x: "%02x" % x, mac))
|
||||||
|
|
||||||
|
|
||||||
|
def get_rundir():
|
||||||
|
if os.geteuid() == 0:
|
||||||
|
return "@RUNTIME_PATH@"
|
||||||
|
|
||||||
|
if "XDG_RUNTIME_DIR" in os.environ:
|
||||||
|
return os.environ["XDG_RUNTIME_DIR"]
|
||||||
|
|
||||||
|
if "HOME" in os.environ:
|
||||||
|
return "%s/.cache/lxc/run/" % os.environ["HOME"]
|
||||||
|
|
||||||
|
raise Exception("Unable to find a runtime directory")
|
||||||
|
|
||||||
|
|
||||||
# Begin parsing the command line
|
# Begin parsing the command line
|
||||||
parser = argparse.ArgumentParser(description=_(
|
parser = argparse.ArgumentParser(description=_(
|
||||||
"LXC: Start an ephemeral container"),
|
"LXC: Start an ephemeral container"),
|
||||||
@ -214,10 +228,15 @@ LXC_NAME="%s"
|
|||||||
entry[0],
|
entry[0],
|
||||||
entry[1]))
|
entry[1]))
|
||||||
elif args.union_type == "aufs":
|
elif args.union_type == "aufs":
|
||||||
|
xino_path = "%s/lxc/aufs.xino" % get_rundir()
|
||||||
|
if not os.path.exists(os.path.basename(xino_path)):
|
||||||
|
os.makedirs(os.path.basename(xino_path))
|
||||||
|
|
||||||
fd.write("mount -n -t aufs "
|
fd.write("mount -n -t aufs "
|
||||||
"-o br=%s=rw:%s=ro,noplink none %s\n" % (
|
"-o br=%s=rw:%s=ro,noplink,xino=%s none %s\n" % (
|
||||||
target,
|
target,
|
||||||
entry[0],
|
entry[0],
|
||||||
|
xino_path,
|
||||||
entry[1]))
|
entry[1]))
|
||||||
count += 1
|
count += 1
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user