Commit 594a08cd authored by Leigh B. Stoller's avatar Leigh B. Stoller

Add -c ("clear the cache") option to clear out the tmcc cache and

refill it from the server.
parent 7a800c04
......@@ -72,6 +72,7 @@ my $beproxy = 0;
"timeout" => undef,
"logfile" => undef,
"nocache" => 0,
"clrcache" => 0,
);
# The cache directory is named by the vnodeid. This avoids some confusion.
......@@ -322,6 +323,13 @@ sub tmcc ($;$$%)
{
my ($cmd, $args, $results, %opthash) = @_;
#
# Clear cache first if requested.
#
if ($config{"clrcache"}) {
tmccgetconfig();
}
#
# See if this is a cmd we can get from the local config stash.
#
......
......@@ -26,9 +26,10 @@ sub usage()
print STDERR " -t timeout Timeout waiting for the controller.\n";
print STDERR " -x path Be a proxy using the unix domain socket\n";
print STDERR " -o path Specify log file name for -x option\n";
print STDERR " -c Clear tmcc cache first (must be root)\n";
exit(1);
}
my $optlist = "ds:p:v:n:k:ul:t:x:o:b";
my $optlist = "ds:p:v:n:k:ul:t:x:o:bc";
my $debug = 0;
my $CMD;
my $ARGS;
......@@ -84,6 +85,13 @@ sub ParseOptions()
if (defined($options{"b"})) {
libtmcc::configtmcc("nocache", 1);
}
if (defined($options{"c"})) {
if ($UID) {
print STDERR "Must be root to use the -c option!\n";
exit(-1);
}
libtmcc::configtmcc("clrcache", 1);
}
if (defined($options{"s"})) {
libtmcc::configtmcc("server", $options{"s"});
}
......
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