Commit 453767f9 authored by Timothy Stack's avatar Timothy Stack

Conditionalize nfs tracing

parent f0b109bc
......@@ -1425,6 +1425,7 @@ MAILMANSUPPORT=0
WINSUPPORT=0
CVSSUPPORT=0
CHATSUPPORT=0
NFSTRACESUPPORT=0
TBLOGFACIL="local5"
LINKTEST_NSPATH="/share/linktest-ns"
BOSSEVENTPORT=2927
......@@ -2586,6 +2587,7 @@ s%@PLABSUPPORT@%$PLABSUPPORT%g
s%@WIKISUPPORT@%$WIKISUPPORT%g
s%@MAILMANSUPPORT@%$MAILMANSUPPORT%g
s%@BUGDBSUPPORT@%$BUGDBSUPPORT%g
s%@NFSTRACESUPPORT@%$NFSTRACESUPPORT%g
s%@TBLOGFACIL@%$TBLOGFACIL%g
s%@PLAB_ROOTBALL@%$PLAB_ROOTBALL%g
s%@PLAB_SLICEPREFIX@%$PLAB_SLICEPREFIX%g
......
......@@ -115,6 +115,7 @@ AC_SUBST(PLABSUPPORT)
AC_SUBST(WIKISUPPORT)
AC_SUBST(MAILMANSUPPORT)
AC_SUBST(BUGDBSUPPORT)
AC_SUBST(NFSTRACESUPPORT)
AC_SUBST(TBLOGFACIL)
AC_SUBST(PLAB_ROOTBALL)
AC_SUBST(PLAB_SLICEPREFIX)
......@@ -206,6 +207,7 @@ MAILMANSUPPORT=0
WINSUPPORT=0
CVSSUPPORT=0
CHATSUPPORT=0
NFSTRACESUPPORT=0
TBLOGFACIL="local5"
LINKTEST_NSPATH="/share/linktest-ns"
BOSSEVENTPORT=2927
......
......@@ -46,6 +46,7 @@ MAILMANSUPPORT=1
SFSSUPPORT=0
CVSSUPPORT=1
CHATSUPPORT=1
NFSTRACESUPPORT=1
#
# SSL Certificate stuff. Used to customize config files in ssl directory.
# Note that OrganizationalUnit is set in the cnf file.
......
......@@ -37,6 +37,7 @@ MAILMANSUPPORT=0
WINSUPPORT=0
SFSSUPPORT=0
CVSSUPPORT=0
NFSTRACESUPPORT=0
DISABLE_NSE=1
# This means it is an inner elab!
ELABINELAB=1
......
......@@ -16,6 +16,7 @@ my $TB = "@prefix@";
my $TBOPS = "@TBOPSEMAIL@";
my $TESTMODE = @TESTMODE@;
my $FSNODE = "@FSNODE@";
my $NFSTRACESUPPORT= @NFSTRACESUPPORT@;
my $FSDIR_GROUPS = "@FSDIR_GROUPS@";
my $FSDIR_PROJ = "@FSDIR_PROJ@";
......@@ -87,6 +88,14 @@ if ($EUID != 0) {
" Must be root! Maybe its a development version?\n");
}
#
# If no bugdb support, just exit.
#
if (! $NFSTRACESUPPORT) {
print "NFS trace support is not enabled. Exit ...\n";
exit(0);
}
# un-taint path
$ENV{'PATH'} = '/bin:/usr/bin:/usr/sbin:/usr/local/bin';
delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
......
......@@ -38,6 +38,7 @@ my $THISHOMEBASE = "@THISHOMEBASE@";
my $TESTMODE = @TESTMODE@;
my $DISABLE_EVENTS = "@DISABLE_EVENT_SCHED@";
my $piper = "$TBROOT/sbin/locpiper";
my $NFSTRACESUPPORT= @NFSTRACESUPPORT@;
# Untaint the path
$ENV{'PATH'} = "/usr/bin:$TBROOT/libexec:$TBROOT/libexec/ns2ir" .
......@@ -402,20 +403,22 @@ sub doSwapout($) {
undef $os_setup_pid;
}
print "Getting files accessed via NFS.\n";
TBDebugTimeStamp("nfstrace started");
if (lc $THISHOMEBASE eq "emulab.net") {
if (defined($umail)) {
SENDMAIL("$TBLOGS",
"Files accessed by $pid/$eid via NFS",
`nfstrace get $pid $eid`,
"$uname <$umail>");
if ($NFSTRACESUPPORT) {
print "Getting files accessed via NFS.\n";
TBDebugTimeStamp("nfstrace started");
if (lc $THISHOMEBASE eq "emulab.net") {
if (defined($umail)) {
SENDMAIL("$TBLOGS",
"Files accessed by $pid/$eid via NFS",
`nfstrace get $pid $eid`,
"$uname <$umail>");
}
}
else {
system("nfstrace get $pid $eid");
}
TBDebugTimeStamp("nfstrace finished");
}
else {
system("nfstrace get $pid $eid");
}
TBDebugTimeStamp("nfstrace finished");
if (! $TESTMODE) {
if (! ($DISABLE_EVENTS || $elabinelab)) {
......@@ -936,13 +939,15 @@ sub doSwapin($) {
}
TBDebugTimeStamp("named finished");
print "Cleaning NFS traces.\n";
TBDebugTimeStamp("nfstrace gc started");
if (system("nfstrace gc $pid $eid")) {
tberror "Failed to setup nfstrace.";
return 1;
if ($NFSTRACESUPPORT) {
print "Cleaning NFS traces.\n";
TBDebugTimeStamp("nfstrace gc started");
if (system("nfstrace gc $pid $eid")) {
tberror "Failed to setup nfstrace.";
return 1;
}
TBDebugTimeStamp("nfstrace gc finished");
}
TBDebugTimeStamp("nfstrace gc finished");
# Check cancel flag before continuing. No retry,
TBGetCancelFlag($pid, $eid, \$canceled);
......
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