Commit adefb79a authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

A set of rather tedious and trivial changes to localize the subject

line in all email from the system. Remove all of the TESTBED: tags
and modify the email function in the web server and perl library to
prepend @DOMAIN@: to the message.
parent 5db6c935
......@@ -1149,7 +1149,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
tbsetup/webnodecontrol tbsetup/node_control \
tbsetup/webmkgroup tbsetup/mkgroup \
tbsetup/webmkacct tbsetup/mkacct \
tbsetup/webmkproj tbsetup/mkproj \
tbsetup/webmkproj tbsetup/mkproj tbsetup/libtestbed.pm \
tip/GNUmakefile \
tmcd/GNUmakefile tmcd/freebsd/GNUmakefile tmcd/linux/GNUmakefile \
tmcd/netbsd/GNUmakefile \
......
......@@ -234,7 +234,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
tbsetup/webnodecontrol tbsetup/node_control \
tbsetup/webmkgroup tbsetup/mkgroup \
tbsetup/webmkacct tbsetup/mkacct \
tbsetup/webmkproj tbsetup/mkproj \
tbsetup/webmkproj tbsetup/mkproj tbsetup/libtestbed.pm \
tip/GNUmakefile \
tmcd/GNUmakefile tmcd/freebsd/GNUmakefile tmcd/linux/GNUmakefile \
tmcd/netbsd/GNUmakefile \
......
......@@ -131,7 +131,7 @@ if (-e "$basename" && system("gzip -9 $basename")) {
fatal("gzip $basename failed!");
}
#system("cat $logname | /usr/bin/mail -s '\"DB Backup Finished\"' stoller");
#SENDMAIL("stoller", "DB Backup Finished", "", undef, undef, ($logname));
unlink("$logname");
exit 0;
......@@ -139,9 +139,8 @@ sub fatal($) {
my ($msg) = @_;
print STDERR "$msg\n";
system("cat $logname | /usr/bin/mail ".
"-s '\"DB Backup Failed\"' \"$TBOPS\"");
SENDMAIL($TBOPS, "DB Backup Failed", $msg, undef, undef, ($logname));
unlink("$logname");
exit(1);
}
......@@ -67,7 +67,7 @@ DBQueryFatal("update images set load_address=''");
#
DBQueryFatal("delete from login");
system("cat $logname | /usr/bin/mail -s '\"DB Boot Finished\"' stoller");
#SENDMAIL("stoller", "DB Boot Finished", "", undef, undef, ($logname));
unlink("$logname");
exit 0;
......@@ -75,9 +75,7 @@ sub fatal($) {
my ($msg) = @_;
print STDERR "$msg\n";
system("cat $logname | /usr/bin/mail ".
"-s '\"DB Boot Failed\"' \"$TBOPS\"");
SENDMAIL($TBOPS, "DB Boot Failed", $msg, undef, undef, ($logname));
unlink("$logname");
exit(1);
}
......@@ -140,6 +140,6 @@ exit 0;
sub fatal {
local($msg) = $_[0];
SENDMAIL($TBOPS, "TESTBED: Failure Generating Email Lists", $msg);
SENDMAIL($TBOPS, "Failure Generating Email Lists", $msg);
die($msg);
}
......@@ -42,6 +42,10 @@ delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
#
$| = 1;
# Load the Testbed support stuff.
use lib "@prefix@/lib";
use libtestbed;
if (@ARGV != 1 || ($ARGV[0] ne "-all" && $ARGV[0] ne "-active")) {
usage();
}
......@@ -74,8 +78,7 @@ exit(0);
sub fatal {
local($msg) = $_[0];
system("echo \"$msg\" | /usr/bin/mail ".
"-s 'TESTBED: Named Setup Failed' $TBOPS");
SENDMAIL($TBOPS, "genelists.proxy failure", $msg);
die($msg);
}
......@@ -1375,10 +1375,9 @@ sub DBWarn($)
$text = "$message - In $progname\n" .
"$DBErrorString\n";
print STDERR "*** $text\n";
print STDERR "*** $text";
system("echo \"$text\" | /usr/bin/mail ".
"-s 'TESTBED: DBError - $message' \"$TBOPS\"");
libtestbed::SENDMAIL($TBOPS, "DBError - $message", $text);
}
#
......
......@@ -83,7 +83,7 @@ while (1) {
print "Exited with status $exit_status at " . TBTimeStamp() . "\n";
SENDMAIL($TBOPS, "TESTBED: Genlastlog Failed!",
SENDMAIL($TBOPS, "Genlastlog Failed!",
"Failed with exit value $exit_status.\n".
"Please look at the syslog entries for genlastlog!");
}
......
......@@ -99,7 +99,8 @@ post-install:
# Control node installation (okay, plastic)
#
control-install: $(addprefix $(INSTALL_SBINDIR)/, console_setup.proxy) \
$(addprefix $(INSTALL_SBINDIR)/, exports_setup.proxy)
$(addprefix $(INSTALL_SBINDIR)/, exports_setup.proxy) \
$(addprefix $(INSTALL_LIBDIR)/, libtestbed.pm)
cd $(INSTALL_BINDIR) && \
list='$(USERBINS)'; for file in $$list; do \
rm -f $$file; \
......
......@@ -594,7 +594,7 @@ sub donotify($$$)
print STDOUT "$mesg";
$subject = "TESTBED: Batch Mode Experiment $subtext $pid/$eid";
$subject = "Batch Mode Experiment $subtext $pid/$eid";
$from = $TBOPS;
$hdrs = "Reply-To: $TBOPS";
......
......@@ -317,7 +317,7 @@ my $message =
"in your message to $TBOPS\n";
SENDMAIL("$user_name <$user_email>",
"TESTBED: Experiment $pid/$eid Terminated",
"Experiment $pid/$eid Terminated",
$message,
"$user_name <$user_email>",
"Cc: $expt_head_name <$expt_head_email>\n".
......@@ -352,7 +352,7 @@ sub fatal($)
# Send a message to the testbed list. Append the logfile.
#
SENDMAIL("$user_name <$user_email>",
"TESTBED: Termination Failure: $pid/$eid",
"Termination Failure: $pid/$eid",
$mesg,
"$user_name <$user_email>",
"Cc: $expt_head_name <$expt_head_email>\n".
......
......@@ -226,7 +226,7 @@ exit(0);
sub fatal {
local($msg) = $_[0];
SENDMAIL($TBOPS, "TESTBED: Exports Setup Failed", $msg);
SENDMAIL($TBOPS, "Exports Setup Failed", $msg);
die($msg);
}
......
......@@ -37,6 +37,12 @@ delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
$| = 1; #Turn off line buffering on output
#
# Testbed Support libraries
#
use lib "@prefix@/lib";
use libtestbed;
#
# Take our input and write it to the tail file.
#
......@@ -110,8 +116,7 @@ exit(0);
sub fatal {
local($msg) = $_[0];
system("echo \"$msg\" | /usr/bin/mail ".
"-s 'TESTBED: Named Setup Failed' $TBOPS");
SENDMAIL($TBOPS, "Exports Setup Failed", $msg);
die($msg);
}
......@@ -37,6 +37,12 @@ delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
$| = 1; #Turn off line buffering on output
#
# Testbed Support libraries
#
use lib "@prefix@/lib";
use libtestbed;
#
# Take our input and write it to the tail file.
#
......@@ -110,8 +116,7 @@ exit(0);
sub fatal {
local($msg) = $_[0];
system("echo \"$msg\" | /usr/bin/mail ".
"-s 'TESTBED: Named Setup Failed' $TBOPS");
SENDMAIL($TBOPS, "Exports Setup Failed", $msg);
die($msg);
}
......@@ -115,7 +115,7 @@ while (1) {
waitpid($child_pid, 0);
if ($?) {
SENDMAIL($TBOPS, "TESTBED: Frisbeed Failed!",
SENDMAIL($TBOPS, "Frisbeed Failed!",
"Imageid: $imageid\n".
"Address: $address\n\n".
"Process $child_pid exited with value $?.\n".
......
......@@ -10,6 +10,8 @@ use Exporter;
qw ( SENDMAIL OPENMAIL TBTimeStamp TBBackGround TBDateTimeFSSafe
TBMakeLogname );
my $MAILTAG = "@OURDOMAIN@";
# A library of useful stuff.
# Send an email message via sendmail -t.
......@@ -23,6 +25,7 @@ use Exporter;
sub SENDMAIL($$$;$$@)
{
my($To, $Subject, $Message, $From, $Headers, @Files) = @_;
my $tag = uc($MAILTAG);
if (! open(MAIL, "|/usr/sbin/sendmail -t")) {
print STDERR "SENDMAIL: Could not start sendmail: $!\n";
......@@ -36,7 +39,7 @@ sub SENDMAIL($$$;$$@)
print MAIL "From: $From\n";
}
print MAIL "To: $To\n";
print MAIL "Subject: $Subject\n";
print MAIL "Subject: $tag: $Subject\n";
if (defined($Headers)) {
print MAIL "$Headers\n";
}
......@@ -88,7 +91,7 @@ sub OPENMAIL($$;$$)
print MAIL "From: $From\n";
}
print MAIL "To: $To\n";
print MAIL "Subject: $Subject\n";
print MAIL "Subject: $tag: $Subject\n";
if (defined($Headers)) {
print MAIL "$Headers\n";
}
......
......@@ -281,6 +281,6 @@ exit(0);
sub fatal {
local($msg) = $_[0];
SENDMAIL($TBOPS, "TESTBED: mkacct-ctrl Failed", $msg);
SENDMAIL($TBOPS, "mkacct Failed", $msg);
die("$0: $msg\n");
}
......@@ -326,7 +326,7 @@ sub donotify($$)
}
SENDMAIL($to,
"TESTBED: Group Creation " . $subtext . ": $pid/$gid",
"Group Creation " . $subtext . ": $pid/$gid",
$mesg, $from, $hdrs,
($logname));
}
......
......@@ -195,6 +195,6 @@ exit(0);
sub fatal {
local($msg) = $_[0];
SENDMAIL($TBOPS, "TESTBED: mkproj $pid Failed", $msg);
SENDMAIL($TBOPS, "mkproj $pid Failed", $msg);
die("$0: $msg\n");
}
......@@ -159,6 +159,6 @@ exit(0);
sub fatal {
local($msg) = $_[0];
SENDMAIL($TBOPS, "TESTBED: Named Setup Failed", $msg);
SENDMAIL($TBOPS, "Named Setup Failed", $msg);
die($msg);
}
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