Commit 264fc28d authored by Mike Hibler's avatar Mike Hibler

Fix some installation nits related to frisbee logs.

We were not logging the upload daemon.
We were not rolling the log for the master server.
parent f1221eb7
......@@ -7,8 +7,8 @@ use installvars;
my @LOGFILES = ("$LOGDIR/bootinfo.log", "$LOGDIR/tmcd.log",
"$LOGDIR/capture.log", "$LOGDIR/dhcpd.log", "$LOGDIR/capserver.log",
"$LOGDIR/frisbeed.log", "$LOGDIR/mfrisbeed.log", "$LOGDIR/proxydhcpd.log",
"$LOGDIR/stated.log", "$LOGDIR/stated-mail.log",
"$LOGDIR/frisbeed.log", "$LOGDIR/frisuploadd", "$LOGDIR/mfrisbeed.log",
"$LOGDIR/proxydhcpd.log", "$LOGDIR/stated.log", "$LOGDIR/stated-mail.log",
"$LOGDIR/osselect.log", "$LOGDIR/power.log", "$LOGDIR/tmcd-meta.log",
"$LOGDIR/tftpd.log", "$LOGDIR/sdcollectd.log", "$LOGDIR/genlastlog.log",
"$LOGDIR/sshxmlrpc.log", "$LOGDIR/plabgetfree.log", "$LOGDIR/xmlrpcbag.log",
......@@ -153,7 +153,8 @@ sub Install($$$)
"$LOGDIR/osselect.log 640 9 300 * Z",
"$LOGDIR/power.log 640 7 300 * Z",
"$LOGDIR/frisbeed.log 640 7 300 * Z",
"$LOGDIR/mfrisbeed.log 640 7 300 * Z",
"$LOGDIR/frisuploadd.log 640 7 300 * Z",
"$LOGDIR/mfrisbeed.log 640 7 1000 * Z",
"$LOGDIR/tftpd.log 640 7 200 * Z",
"$LOGDIR/dhcpd.log 640 7 200 * Z",
"$LOGDIR/bootinfo.log 640 7 200 * Z",
......
#
# Doh! Forgot to create the logfile for the master frisbee server.
#
use strict;
use libinstall;
my $SYSLOG_CONF = "/etc/syslog.conf";
my $NEWSYSLOG_CONF = "/etc/newsyslog.conf";
my $FRISUPLOG = "$TBROOT/log/frisuploadd.log";
my $MFRISLOG = "$TBROOT/log/mfrisbeed.log";
my $CHMOD = "/bin/chmod";
my $CHGRP = "/usr/bin/chgrp";
sub InstallUpdate($$)
{
my ($version, $phase) = @_;
#
# If something should run in the pre-install phase.
#
if ($phase eq "pre") {
Phase "frisuploaddlog", "Create frisbee upload server log", sub {
Phase "syslog.conf", "Updating $SYSLOG_CONF", sub {
DoneIfEdited($SYSLOG_CONF);
BackUpFileFatal($SYSLOG_CONF);
AppendToFileFatal($SYSLOG_CONF,
"!frisuploadd", "*.*\t\t\t\t\t\t$LOGDIR/frisuploadd.log");
};
Phase "logfile", "Creating $FRISUPLOG", sub {
DoneIfExists($FRISUPLOG);
CreateFileFatal($FRISUPLOG);
ExecQuietFatal("$CHGRP tbadmin $FRISUPLOG");
ExecQuietFatal("$CHMOD 640 $FRISUPLOG");
};
Phase "syslogd", "Restarting syslogd", sub {
HUPDaemon("syslog");
};
};
# Argh, forgot to roll the mfrisbeed log back in 20.
Phase "rollfrislogs", "Roll frisbee server logs", sub {
my @lines = ();
DoneIfEdited($NEWSYSLOG_CONF);
if (system("grep -q $MFRISLOG $NEWSYSLOG_CONF")) {
push(@lines, "$MFRISLOG 640 7 1000 * Z");
}
if (system("grep -q $FRISUPLOG $NEWSYSLOG_CONF")) {
push(@lines, "$FRISUPLOG 640 7 300 * Z");
}
if (@lines > 0) {
BackUpFileFatal($NEWSYSLOG_CONF);
AppendToFileFatal($NEWSYSLOG_CONF, @lines);
}
};
}
#
# If something should run in the post-install phase.
#
if ($phase eq "post") {
}
return 0;
}
1;
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