Commit 4a355379 authored by Tom Mitchell's avatar Tom Mitchell
Browse files

Merge branch 'master' into geni-am-devel

parents 10622aed ac6a35f1
......@@ -30,7 +30,7 @@ include Makeconf
# Then things that depend on stuff we just did:
#
ifeq ($(STANDALONE_CLEARINGHOUSE),0)
SUBDIRS = lib db assign www @optional_subdirs@ ipod security sensors \
SUBDIRS = lib apache db assign www @optional_subdirs@ ipod security sensors \
pxe tbsetup account tmcd utils backend tip capture ipod vis \
sensors os xmlrpc install/newnode_sshkeys mote tools/whol \
tools/svn wiki bugdb collab protogeni node_usage install
......@@ -41,7 +41,7 @@ else
SUBDIRS = db tbsetup account protogeni
endif
all: all-subdirs
all: all-subdirs just-builddirs
#
# We used to statically link our event agents. We no longer do this, but
......@@ -176,6 +176,10 @@ ifeq ($(STANDALONE_CLEARINGHOUSE),0)
-ln -s /usr/testbed/bin/nse $(INSTALL_TOPDIR)/bin
endif
just-builddirs:
@$(MAKE) -C rc.d all
@$(MAKE) -C apache all
tipserv-install:
-mkdir -p $(INSTALL_TOPDIR)/log/tiplogs
-mkdir -p $(INSTALL_TOPDIR)/etc
......@@ -425,6 +429,11 @@ elabinelab:
rm -f $(INSTALL_TOPDIR)/src/emulab-src.tar.gz
tar czf $(INSTALL_TOPDIR)/src/emulab-src.tar.gz -C $(SRCDIR) --exclude=.git .
elabinelab-git:
-mkdir -p $(INSTALL_TOPDIR)/src
rm -f $(INSTALL_TOPDIR)/src/emulab-src.tar.gz
git archive --prefix=testbed/ | gzip -c > $(INSTALL_TOPDIR)/src/emulab-src.tar.gz
# How to recursively descend into subdirectories to make general
# targets such as `all'.
%.MAKE:
......
......@@ -1337,6 +1337,7 @@ SSLCARevocationFile @prefix@/etc/genicrl.bundle
# supplying a verifiable certificate.
#
SSLVerifyClient optional
SSLVerifyDepth 10
# Reject the unencrypted certs that all users get.
<Location />
......@@ -1354,7 +1355,6 @@ ScriptAlias /protogeni/xmlrpc/am @prefix@/protogeni/xmlrpc/geni-am.pl
SSLRequireSSL
Order deny,allow
allow from all
SSLVerifyDepth 5
</Directory>
<Directory "@prefix@/protogeni/">
SSLRequireSSL
......@@ -1364,7 +1364,6 @@ ScriptAlias /protogeni/xmlrpc/am @prefix@/protogeni/xmlrpc/geni-am.pl
Options +ExecCGI +FollowSymLinks
SetHandler cgi-script
SetEnv USER "nobody"
SSLVerifyDepth 5
</Directory>
</IfDefine>
</VirtualHost>
......
......@@ -11,9 +11,9 @@ UNIFIED = @UNIFIED_BOSS_AND_OPS@
include $(OBJDIR)/Makeconf
SUBBOSS_BIN_SCRIPTS = subboss_dhcpd_makeconf
SUBBOSS_SBIN_SCRIPTS = subboss_dhcpd_makeconf
BIN_SCRIPTS = nalloc nfree nodeip readycount subboss_dhcpd_makeconf
BIN_SCRIPTS = nalloc nfree nodeip readycount
SBIN_SCRIPTS = avail inuse showgraph if2port backup webcontrol node_status \
genelists genelists.proxy dhcpd_makeconf nodelog unixgroups \
dbcheck interswitch dbboot grabron stategraph newwanode \
......@@ -58,7 +58,7 @@ endif
#
all: $(TARGETS)
$(SUBBOSS_BIN_SCRIPTS):
$(SUBBOSS_SBIN_SCRIPTS):
include $(TESTBED_SRCDIR)/GNUmakerules
......@@ -68,7 +68,9 @@ else
install: clrhouse-install
endif
subboss-install: $(addprefix $(INSTALL_BINDIR)/, $(SUBBOSS_BIN_SCRIPTS))
subboss-install: $(addprefix $(INSTALL_SBINDIR)/, $(SUBBOSS_SBIN_SCRIPTS))
ln -sf $(INSTALL_SBINDIR)/subboss_dhcpd_makeconf \
$(CLIENT_BINDIR)/subboss_dhcpd_makeconf
boss-install: $(addprefix $(INSTALL_BINDIR)/, $(BIN_SCRIPTS)) \
$(addprefix $(INSTALL_SBINDIR)/, $(SBIN_SCRIPTS)) \
......@@ -78,7 +80,7 @@ boss-install: $(addprefix $(INSTALL_BINDIR)/, $(BIN_SCRIPTS)) \
$(addprefix $(INSTALL_DIR)/opsdir/lib/, $(USERLIBS))
post-install:
chown root $(INSTALL_BINDIR)/subboss_dhcpd_makeconf
chown root $(INSTALL_SBINDIR)/subboss_dhcpd_makeconf
chown root $(INSTALL_SBINDIR)/genelists
chmod u+s $(INSTALL_SBINDIR)/genelists
chown root $(INSTALL_SBINDIR)/dhcpd_makeconf
......
......@@ -57,6 +57,9 @@ my %singlectlnet = ();
my $template = $DHCPD_TEMPLATE;
my $outfile = "/tmp/dhcpd_makeconf.$$";
my $OUT = *STDOUT;
my %subboss_dhcp_servers;
sub RestartSubbossDhcp($$);
#
# Parse command arguments. Once we return from getopts, all that should
......@@ -175,6 +178,7 @@ while (my %row = $query_result->fetchhash()) {
$tftp_subbosses{$node_id} = $row{"IP"};
} elsif ($row{"service"} eq 'dhcp') {
$dhcp_subbosses{$node_id} = $row{"IP"};
$subboss_dhcp_servers{$row{"subboss_id"}} = 1;
} elsif ($row{"service"} eq 'bootinfo') {
$bootinfo_subbosses{$node_id} = $row{"IP"};
}
......@@ -365,6 +369,11 @@ if ($install) {
fatal("Could not kill(TERM) process $dpid (dhcpd): $!");
}
}
for my $subboss (keys %subboss_dhcp_servers) {
RestartSubbossDhcp($subboss, $restart);
}
TBScriptUnlock();
}
exit(0);
......@@ -382,3 +391,17 @@ sub fatal {
" $msg\n");
}
sub RestartSubbossDhcp($$)
{
my ($subboss, $restart) = @_;
my $cmd = "ssh $subboss @prefix@/sbin/subboss_dhcpd_makeconf";
$cmd .= " -r" if ($restart);
print "Restarting dhcpd on subboss $subboss\n";
if (system($cmd)) {
print STDERR "Failed to restart dhcpd on $subboss\n";
}
}
......@@ -385,7 +385,7 @@ sub GetTickets($$$$)
};
print STDERR "Getting all tickets in parallel ...\n";
if (ParRun(undef, \@results, $coderef, @resources)) {
if (ParRun({'maxwaittime' => 600}, \@results, $coderef, @resources)) {
print STDERR "*** GetTickets: Internal error getting tickets\n";
#
# Need to be careful here; some of the tickets might have been
......@@ -452,7 +452,7 @@ sub RedeemTickets($$$)
};
print STDERR "Redeeming all tickets in parallel ...\n";
if (ParRun({'maxwaittime' => 300}, \@results, $coderef, @resources)) {
if (ParRun({'maxwaittime' => 600}, \@results, $coderef, @resources)) {
print STDERR "*** RedeemTickets: Internal error getting tickets\n";
#
# Need to be careful here; some of the tickets might have been
......@@ -710,6 +710,9 @@ sub MapNodes($$)
}
}
}
print STDERR Dumper($manifest)
if ($verbose);
# The manifest was changed above.
if ($resource->UpdateManifest($manifest)) {
print STDERR "Could not store manifest for $resource\n";
......@@ -776,7 +779,7 @@ sub StartSlivers($$$$)
};
print STDERR "Starting all slivers in parallel ...\n";
if (ParRun(undef, \@results, $coderef, @resources)) {
if (ParRun({'maxwaittime' => 600}, \@results, $coderef, @resources)) {
print STDERR "*** StartSlivers: Internal error starting slivers.\n";
return -1;
}
......@@ -1092,7 +1095,7 @@ sub DeleteAllSlivers($$)
};
print STDERR "Deleting all slivers in parallel ...\n";
if (ParRun(undef, \@results, $coderef, @resources)) {
if (ParRun({'maxwaittime' => 600}, \@results, $coderef, @resources)) {
print STDERR
"*** DeleteAllSlivers: Internal error deleting slivers.\n";
#
......
#
# Note that all actions *MUST* be idempotent; if this script is run
# again, it should always do the right thing, not break if something
# was already done. See boss-install for lots of example of how to use
# libinstall to help with this.
#
use strict;
use libinstall;
my $APACHECONF = "/usr/local/etc/apache/httpd.conf";
sub InstallUpdate($$)
{
my ($version, $phase) = @_;
#
# If something should run in the pre-install phase.
#
if ($phase eq "pre") {
}
#
# If something should run in the post-install phase.
#
if ($phase eq "post") {
if ($PGENISUPPORT) {
Phase "httpd.conf", "Updating apache config file", sub {
#
# This might be a rare case.
#
DoneIfIdentical("$TOP_OBJDIR/apache/httpd.conf", $APACHECONF);
#
# Check to see if SSLVerifyClient has been set to optional
#
PhaseSkip("Already updated")
if `grep '^SSLVerifyDepth 10' $APACHECONF`;
BackUpFileFatal($APACHECONF);
# For impotent mode.
DiffFiles("$TOP_OBJDIR/apache/httpd.conf", $APACHECONF);
ExecQuietFatal("$GMAKE -C $TOP_OBJDIR/apache install");
};
Phase "httpd", "Restarting apache", sub {
DoneIfDoesntExist("$VARRUN/httpd.pid");
ExecQuietFatal("$RCDIR/apache.sh restart");
};
}
}
return 0;
}
1;
......@@ -306,7 +306,7 @@ sub AssignLoop()
# experiments are using shared nodes. Eventually needs to be
# a barrier.
#
if ((!($impotent || $regression)) && $vtop->sharednodecount()) {
if (0 && (!($impotent || $regression)) && $vtop->sharednodecount()) {
while (1) {
my $lock_result =
DBQueryWarn("select get_lock('pool_daemon', 10)");
......
......@@ -7922,7 +7922,7 @@ COMMAND_PROTOTYPE(dodhcpdconf)
"left join interfaces as i on n.node_id = i.node_id "
"left join reserved as r on n.node_id = r.node_id "
"where s.subboss_id = '%s' and "
"s.service='dhcp' and i.role='ctrl'", 11,
"s.service='dhcp' and i.role='ctrl' order by n.priority", 11,
reqp->nodeid);
if (!res) {
......
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