Commit bf02857e authored by Mac Newbold's avatar Mac Newbold

Added db/genelists and made the associated changes in configure/make files.

parent 965565da
......@@ -23,6 +23,7 @@ boss-install: install-subdirs install-mkdirs
@echo "DON'T FORGET TO RUN A POST-INSTALL AS ROOT"
post-install:
@$(MAKE) -C db post-install
@$(MAKE) -C ipod post-install
@$(MAKE) -C tbsetup post-install
@$(MAKE) -C security post-install
......
......@@ -925,7 +925,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
assign/GNUmakefile \
capture/GNUmakefile \
db/GNUmakefile db/nalloc db/nfree db/if2port db/backup \
db/webcontrol db/node_status discvr/GNUmakefile \
db/webcontrol db/node_status db/genelists discvr/GNUmakefile \
db/libdb.pm \
ipod/GNUmakefile \
lib/GNUmakefile \
......
......@@ -98,7 +98,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
assign/GNUmakefile \
capture/GNUmakefile \
db/GNUmakefile db/nalloc db/nfree db/if2port db/backup \
db/webcontrol db/node_status discvr/GNUmakefile \
db/webcontrol db/node_status db/genelists discvr/GNUmakefile \
db/libdb.pm \
ipod/GNUmakefile \
lib/GNUmakefile \
......
......@@ -9,7 +9,8 @@ SUBDIR = db
include $(OBJDIR)/Makeconf
BIN_SCRIPTS = mac2if nalloc nfree nodeip
SBIN_SCRIPTS = avail inuse showgraph if2port backup webcontrol node_status
SBIN_SCRIPTS = avail inuse showgraph if2port backup webcontrol node_status \
genelists
LIBEXEC_SCRIPTS = ptopgen
LIB_SCRIPTS = libdb.pm
......@@ -29,6 +30,10 @@ install: $(addprefix $(INSTALL_BINDIR)/, $(BIN_SCRIPTS)) \
$(addprefix $(INSTALL_LIBDIR)/, $(LIB_SCRIPTS)) \
$(addprefix $(INSTALL_LIBEXECDIR)/, $(LIBEXEC_SCRIPTS))
post-install:
chown root $(INSTALL_SBINDIR)/genelists
chmod u+s $(INSTALL_SBINDIR)/genelists
#
# Control node installation (okay, plastic)
#
......
#!/usr/bin/perl -wT
use English;
#use Getopt::Std;
sub usage() {
print STDOUT "Usage: genelists\n".
"Generate the email list files after things change\n";
exit(-1);
}
my $optlist = "";
# Configure variables
my $TB = "@prefix@";
my $TBOPS = "@TBOPSEMAIL@";
my $lockfile = "/var/tmp/testbed_genelists_lockfile";
my $active = 0;
my $userlist = 0;
my $d = 0;
if (@ARGV != 0) { usage(); }
$| = 1; # Turn off line buffering on output
# Load the Testbed support stuff.
push(@INC, "$TB/lib");
require libdb;
foreach $active ( 0, 1 ) {
if ($active) {
print "Getting Active Users\n" if $d;
# All active users on the testbed
if (! ($query_result =
DBQuery("SELECT DISTINCT u.usr_email from experiments as e ".
"left join proj_memb as p on e.pid=p.pid ".
"left join users as u on u.uid=p.uid ".
"where u.status='active' order by u.usr_email"))
) {
DBFatal("Getting Active Users!");
}
$userlist = "testbed-ops\@flux.cs.utah.edu
testbed-active-users-archive\@flux.cs.utah.edu\n";
open(LIST,">/mnt/usr/site/lib/lists/testbed-active-users") ||
die("Couldn't open testbed-active-users: $!\n");
print "Opened testbed-active-users\n" if $d;
} else {
print "Getting All Users\n" if $d;
# All approved users on the testbed
if (!($query_result =
DBQuery("SELECT DISTINCT usr_email FROM users ".
"where status='active' order by usr_email"))
) {
DBFatal("Getting Users!");
}
$userlist = "testbed-ops\@flux.cs.utah.edu
testbed-users-archive\@flux.cs.utah.edu\n";
open(LIST,">/mnt/usr/site/lib/lists/testbed-users") ||
die("Couldn't open testbed-users: $!\n");
print "Opened testbed-users list\n" if $d;
}
for ($i = 0; $i < $query_result->numrows; $i++) {
$user_email = ($query_result->fetchrow_array())[0];
if (! defined($user_email)) { next; }
if ($userlist) { $userlist .= "$user_email\n"; }
else { $userlist = "$user_email\n"; }
}
print LIST $userlist;
print $userlist if $d;
close(LIST);
}
exit 0;
sub fatal {
local($msg) = $_[0];
system("echo \"$msg\" | /usr/bin/mail ".
"-s 'TESTBED: Failure Generating Email Lists' $TBOPS");
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