Commit c8c2b569 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Kill of savevlans since its simply a snapshot of DB state, and not

very useful by itself anyway.
parent a73e627e
......@@ -1139,7 +1139,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
tbsetup/startexp tbsetup/endexp tbsetup/webstartexp tbsetup/webendexp \
tbsetup/snmpit tbsetup/ns2ir/GNUmakefile \
tbsetup/ns2ir/parse.tcl tbsetup/ns2ir/tb_compat.tcl \
tbsetup/ns2ir/sim.tcl tbsetup/savevlans tbsetup/db2ns \
tbsetup/ns2ir/sim.tcl tbsetup/db2ns \
tbsetup/tbprerun tbsetup/tbswapin tbsetup/tbswapout tbsetup/tbend \
tbsetup/tbreport tbsetup/named_setup tbsetup/exports_setup \
tbsetup/checkpass/GNUmakefile tbsetup/assign_wrapper tbsetup/ptopgen \
......
......@@ -224,7 +224,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
tbsetup/startexp tbsetup/endexp tbsetup/webstartexp tbsetup/webendexp \
tbsetup/snmpit tbsetup/ns2ir/GNUmakefile \
tbsetup/ns2ir/parse.tcl tbsetup/ns2ir/tb_compat.tcl \
tbsetup/ns2ir/sim.tcl tbsetup/savevlans tbsetup/db2ns \
tbsetup/ns2ir/sim.tcl tbsetup/db2ns \
tbsetup/tbprerun tbsetup/tbswapin tbsetup/tbswapout tbsetup/tbend \
tbsetup/tbreport tbsetup/named_setup tbsetup/exports_setup \
tbsetup/checkpass/GNUmakefile tbsetup/assign_wrapper tbsetup/ptopgen \
......
......@@ -11,7 +11,7 @@ include $(OBJDIR)/Makeconf
SUBDIRS = checkpass ns2ir
BIN_STUFF = power snmpit tbend tbswapin tbswapout tbprerun tbreport \
os_load savevlans startexp endexp batchexp swapexp \
os_load startexp endexp batchexp swapexp \
node_reboot nscheck node_update savelogs node_control
# Stuff that mere users get on plastic.
......@@ -86,8 +86,6 @@ post-install:
chmod u+s $(INSTALL_SBINDIR)/named_setup
chown root $(INSTALL_SBINDIR)/exports_setup
chmod u+s $(INSTALL_SBINDIR)/exports_setup
chown root $(INSTALL_BINDIR)/savevlans
chmod u+s $(INSTALL_BINDIR)/savevlans
chown root $(INSTALL_SBINDIR)/setgroups
chmod u+s $(INSTALL_SBINDIR)/setgroups
chown root $(INSTALL_LIBEXECDIR)/console_setup
......
#!/usr/bin/perl -wT
#
# savevlans - dump vlans table into a file, suitable for restoration with
# "load data infile '$name' replace into table vlans;"
#
#
# Configure variables
#
my $TBROOT = "@prefix@";
my $TESTMODE = @TESTMODE@;
#
# Untaint the path
#
$ENV{'PATH'} = "/bin:/usr/bin";
delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
#
# Turn off line buffering on output
#
$| = 1;
#
# Load the Testbed support stuff.
#
use lib "@prefix@/lib";
use libdb;
use libtestbed;
# Gen up a file name. Technically unsafe, but not likely to be a problem.
my $name = "vlans-" . TBDateTimeFSSafe();
print "Saving VLAN configuration to '$name'\n";
DBQueryFatal("select * from vlans into outfile '/tmp/$name'");
system("mv /tmp/$name $TBROOT/backup/$name") &&
die("*** Could not move /tmp/$name to $TBROOT/backup/$name!\n");
chown( 0, 601, "$TBROOT/backup/$name") ||
die("*** Could not chown $TBROOT/backup/$name: $!\n");
chmod( 0444, "$TBROOT/backup/$name") ||
die("*** Could not chmod $TBROOT/backup/$name: $!\n");
......@@ -53,11 +53,6 @@ sub cleanup {
if (system("snmpit -r $pid $eid")) {
print STDERR "*** Failed to clean up VLANs\n";
}
print STDERR "Backing up VLAN configuration\n";
if (system("savevlans")) {
print STDERR "*** WARNING: Failed to back up VLAN configuration\n";
}
}
print STDERR "Freeing up nodes.\n";
......@@ -127,14 +122,6 @@ if (system("snmpit -t $pid $eid")) {
#
$cleanvlans = 1;
print "Backing up VLAN configuration.\n";
if (system("savevlans")) {
print STDERR "*** WARNING: Failed to back up VLAN configuration.\n";
#
# This is a non-fatal error.
#
}
print "Setting up mountpoints.\n";
if (system("exports_setup")) {
print STDERR "*** Failed to setup mountpoints.\n";
......
......@@ -94,11 +94,6 @@ if (! $TESTMODE) {
print STDERR "*** Failed to reset VLANs.\n";
$errors = 1;
}
print "Backing up VLAN configuration.\n";
if (system("savevlans")) {
print STDERR "*** WARNING: Failed to back up VLAN configuration.\n";
}
}
print "Freeing resources.\n";
......
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