Commit 58d9d43e authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Merge branch 'master' of git-public.flux.utah.edu:/flux/git/emulab-devel

parents 2d26cca7 282e4ded
......@@ -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";
}
}
......@@ -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