Commit 7f186841 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 5b8f9f7d 0ce2d5b3
......@@ -1825,9 +1825,12 @@ sub StartEvents()
print STDERR "Caught a USR2 in child\n";
# Only STDERR can be redirected to the newfile. STDOUT is writing
# to the parent process.
close(STDERR);
open(STDERR, ">> $LOGFILE") or fatal("reopening $LOGFILE: $!");
select STDERR;
$OUTPUT_AUTOFLUSH = 1;
# restore default output.
select STDOUT;
print STDERR "Opened new logfile in child\n";
};
......
#
# Remove stated from syslog.conf, since we no longer use syslog.
# It holds open the log file when it is rolled.
#
use strict;
use libinstall;
my $SYSLOG_CONF = "/etc/syslog.conf";
sub InstallUpdate($$)
{
my ($version, $phase) = @_;
#
# If something should run in the pre-install phase.
#
if ($phase eq "pre") {
Phase "stated", "Updating stated logging", sub {
Phase "syslog.conf", "Updating $SYSLOG_CONF", sub {
PhaseSkip("Already updated")
if !`grep 'stated' $SYSLOG_CONF`;
BackUpFileFatal($SYSLOG_CONF);
ExecQuietFatal("sed -i .orig -e '/stated/d' $SYSLOG_CONF");
};
Phase "syslogd", "Restarting syslogd", sub {
HUPDaemon("syslog");
};
};
}
#
# If something should run in the post-install phase.
#
if ($phase eq "post") {
}
return 0;
}
1;
......@@ -2269,10 +2269,13 @@ sub _LoadDefaultImages($$)
{
return 0;
}
sub _LoadCurrentImages($$)
{
return 0;
}
#
# But we *do* want the user to be able to simply reload the current OS.
#
#sub _LoadCurrentImages($$)
#{
# return 0;
#}
sub SetupReload($$)
{
......
......@@ -1341,6 +1341,14 @@ sub generateConfig($$) {
};
my @cnetlines = ();
#
# We *HAVE* to remove anything that might have snuck into vlan 1
# in the control net subnet, before trying to assign one in vlan 999.
# This seems to sometimes happen via DHCP...
#
push @cnetlines, "vlan 1";
push @cnetlines, " no ip address";
push @cnetlines, "exit";
if (defined($cnetport) && $cnetport ne '') {
push @cnetlines, "vlan 999";
push @cnetlines, " name \"EmulabControlPort\"";
......@@ -1374,6 +1382,25 @@ sub generateConfig($$) {
}
}
my $community = "private";
my $qres = DBQueryFatal("select sst.snmp_community" .
" from switch_stacks as ss" .
" left join switch_stack_types as sst" .
" on ss.stack_id=sst.stack_id" .
" where ss.node_id='$node_id'");
if (defined($qres) && $qres->numrows()) {
my @row = $qres->fetchrow_array();
if (!defined($row[0])) {
tbwarn "Could not find snmp_community for experiment switch $node_id, using default of '$community'!\n";
}
else {
$community = $row[0];
}
}
else {
tbwarn "Could not find snmp_community for experiment switch $node_id!\n";
}
my @config = (
"hostname \"" . $node_id . "\"",
@cnetlines,
......@@ -1383,6 +1410,10 @@ sub generateConfig($$) {
"aaa authentication ssh login local",
@keylines,
@passwdlines,
'snmp-server community "' . $community . '" Unrestricted',
'snmp-server contact "testbed-ops@flux.utah.edu"',
# try to cover our hind ends and eliminate loops!
"spanning-tree",
"no web-management",
"no telnet-server",
"tftp client",
......
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