Commit d6313db3 authored by Mike Hibler's avatar Mike Hibler
Browse files

Add /var/emulab/vms to the list of directories we clean.

We also make sure that all dirs in /var/emulab are really dirs and
not symlinks. Having /var/emulab/vms be a symlink (left over from
a vnode setup) caused vast confusion when trying to use the new
images for vnodes.

Note: you really, really should not image the vhost in an experiment
with vnodes. Prepare in such an environment is destructive and you
won't get a clean image anyway (due to LVM state). Swap the Xen image
in on a node directly and image that.
parent b08fd2ea
#!/usr/bin/perl -w
# Copyright (c) 2000-2013 University of Utah and the Flux Group.
# Copyright (c) 2000-2014 University of Utah and the Flux Group.
......@@ -32,7 +32,7 @@ my $DUMPDATES = "/etc/dumpdates";
my @DBFILES = ();
my @SYSVARDIRS = ("lib/dhcp", "lib/dhclient", "lib/dhcp3", "spool/clientmqueue",
"log/audit", "log/account", "log/mysql", "log/ntpstats");
my @VARDIRS = ("logs", "db", "jails", "boot", "lock");
my @VARDIRS = ("logs", "db", "jails", "boot", "lock", "vms");
my @SOCKETS = ("/dev/log", "/var/run/acpid.socket");
my $FSTAB = "/etc/fstab";
my $LOGDIR = "/var/log";
......@@ -341,7 +341,13 @@ system("rm -f /var/lib/rpm/__db*");
print "Clearing out directories in $VARDIR ...\n";
foreach my $dir (@VARDIRS) {
if (-d "$VARDIR/$dir") {
# If it is a symlink, make it a real directory
# XXX really just for vnode dirs ("vms")
if (-l "$VARDIR/$dir") {
mkdir("$VARDIR/$dir", 0755);
elsif (-d "$VARDIR/$dir") {
system("rm -rf $VARDIR/$dir/*");
Supports Markdown
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