Commit 721568af authored by David Johnson's avatar David Johnson

Preserve an already-moved (to /vms) /var/lib/docker across reloads.

parent 2baa00bb
...@@ -2168,16 +2168,18 @@ sub rootPreConfig($;$) ...@@ -2168,16 +2168,18 @@ sub rootPreConfig($;$)
TBScriptUnlock(); TBScriptUnlock();
return -1; return -1;
} }
mkdir("$EXTRAFS/var.lib.docker"); if (! -d "$EXTRAFS/var.lib.docker") {
# mkdir("$EXTRAFS/var.lib.docker");
# We need this stuff to be sticky across reloads, so move it #
# into an lvm. If we lose the lvm, well then we are screwed. # We need this stuff to be sticky across reloads, so move it
# # into an lvm. If we lose the lvm, well then we are screwed.
my @files = glob("/var/lib/docker/*"); #
foreach my $file (@files) { my @files = glob("/var/lib/docker/*");
my $base = basename($file); foreach my $file (@files) {
mysystem("/bin/mv $file $EXTRAFS/var.lib.docker") my $base = basename($file);
if (! -e "$EXTRAFS/var.lib.docker/$base"); mysystem("/bin/mv $file $EXTRAFS/var.lib.docker")
if (! -e "$EXTRAFS/var.lib.docker/$base");
}
} }
mysystem("/bin/rm -rf /var/lib/docker"); mysystem("/bin/rm -rf /var/lib/docker");
mysystem("/bin/ln -s $EXTRAFS/var.lib.docker /var/lib/docker"); mysystem("/bin/ln -s $EXTRAFS/var.lib.docker /var/lib/docker");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment