Commit a2af9837 authored by Franco Fichtner's avatar Franco Fichtner

src: purge long gone fifolog support

parent 8d65afe8
......@@ -49,9 +49,6 @@ function conv_log_filter($logfile, $nentries, $tail = 50, $filtertext = '', $fil
/* Always do a reverse tail, to be sure we're grabbing the 'end' of the log. */
$logarr = "";
if(isset($config['system']['usefifolog']))
exec("/usr/sbin/fifolog_reader " . escapeshellarg($logfile) . " | /usr/bin/grep 'filterlog:' | /usr/bin/tail -r -n {$tail}", $logarr);
else
exec("/usr/local/sbin/clog " . escapeshellarg($logfile) . " | grep -v \"CLOG\" | grep -v \"\033\" | /usr/bin/grep 'filterlog:' | /usr/bin/tail -r -n {$tail}", $logarr);
$filterlog = array();
......
......@@ -633,18 +633,11 @@ function system_syslogd_start()
if (file_exists("/var/run/booting"))
echo gettext("Starting syslog...");
if (is_process_running("fifolog_writer"))
mwexec('/bin/pkill fifolog_writer');
// Which logging type are we using this week??
if (isset($config['system']['disablesyslogclog'])) {
$log_directive = "";
$log_create_directive = "/usr/bin/touch ";
$log_size = "";
} else if (isset($config['system']['usefifolog'])) {
$log_directive = "|/usr/sbin/fifolog_writer ";
$log_size = isset($config['syslog']['logfilesize']) ? $config['syslog']['logfilesize'] : "10240";
$log_create_directive = "/usr/sbin/fifolog_create -s ";
} else { // Defaults to CLOG
$log_directive = "%";
$log_size = isset($config['syslog']['logfilesize']) ? $config['syslog']['logfilesize'] : "10240";
......
......@@ -185,7 +185,6 @@ chmod 1777 /tmp
echo -n "."
DISABLESYSLOGCLOG=`/usr/bin/grep -c disablesyslogclog /conf/config.xml`
ENABLEFIFOLOG=`/usr/bin/grep -c usefifolog /conf/config.xml`
LOG_FILES="system filter dhcpd vpn pptps poes l2tps openvpn portalauth ipsec ppps relayd wireless lighttpd ntpd gateways resolver routing"
DEFAULT_LOG_FILE_SIZE=`/usr/local/bin/xmllint --xpath 'string(//opnsense/syslog/logfilesize)' /conf/config.xml`
......@@ -195,22 +194,15 @@ fi
for logfile in $LOG_FILES; do
if [ "$DISABLESYSLOGCLOG" -gt "0" ]; then
/usr/bin/touch /var/log/$logfile.log
touch /var/log/$logfile.log
else
if [ ! -f /var/log/$logfile.log ]; then
if [ "$ENABLEFIFOLOG" -gt "0" ]; then
# generate fifolog files
/usr/sbin/fifolog_create -s ${DEFAULT_LOG_FILE_SIZE} /var/log/$logfile.log
else
/usr/local/sbin/clog -i -s ${DEFAULT_LOG_FILE_SIZE} /var/log/$logfile.log
fi
clog -i -s ${DEFAULT_LOG_FILE_SIZE} /var/log/$logfile.log
fi
fi
chmod 0600 /var/log/$logfile.log
done
# change permissions on newly created fifolog files.
chmod 0600 /var/log/*.log
echo -n "."
/sbin/ldconfig -elf /usr/lib /usr/local/lib /lib
/etc/rc.d/ldconfig start 2>/dev/null
......
......@@ -75,9 +75,6 @@ function dump_clog_vpn($logfile, $tail) {
$logarr = "";
if(isset($config['system']['usefifolog']))
exec("/usr/sbin/fifolog_reader " . escapeshellarg($logfile) . " | tail {$sor} -n " . $tail, $logarr);
else
exec("/usr/local/sbin/clog " . escapeshellarg($logfile) . " | tail {$sor} -n " . $tail, $logarr);
foreach ($logarr as $logent) {
......
......@@ -483,7 +483,8 @@ function update_changedesc($update) {
$changecount++;
}
function clear_log_file($logfile = "/var/log/system.log", $restart_syslogd = true) {
function clear_log_file($logfile = '/var/log/system.log', $restart_syslogd = true)
{
global $config, $g;
if ($restart_syslogd)
exec("/usr/bin/killall syslogd");
......@@ -492,13 +493,11 @@ function clear_log_file($logfile = "/var/log/system.log", $restart_syslogd = tru
touch($logfile);
} else {
$log_size = isset($config['syslog']['logfilesize']) ? $config['syslog']['logfilesize'] : "511488";
if(isset($config['system']['usefifolog']))
exec("/usr/sbin/fifolog_create -s {$log_size} " . escapeshellarg($logfile));
else
exec("/usr/local/sbin/clog -i -s {$log_size} " . escapeshellarg($logfile));
}
if ($restart_syslogd)
if ($restart_syslogd) {
system_syslogd_start();
}
}
function clear_all_log_files()
......@@ -536,9 +535,6 @@ function dump_clog($logfile, $tail, $withorig = true, $grepfor = "", $grepinvert
if($config['system']['disablesyslogclog']) {
exec("cat " . escapeshellarg($logfile) . "{$grepline} | /usr/bin/tail {$sor} -n " . escapeshellarg($tail), $logarr);
} else {
if(isset($config['system']['usefifolog']))
exec("/usr/sbin/fifolog_reader " . escapeshellarg($logfile) . "{$grepline} | /usr/bin/tail {$sor} -n " . escapeshellarg($tail), $logarr);
else
exec("/usr/local/sbin/clog " . escapeshellarg($logfile) . "{$grepline}| grep -v \"CLOG\" | grep -v \"\033\" | /usr/bin/tail {$sor} -n " . escapeshellarg($tail), $logarr);
}
}
......@@ -546,17 +542,11 @@ function dump_clog($logfile, $tail, $withorig = true, $grepfor = "", $grepinvert
$logent = preg_split("/\s+/", $logent, 6);
echo "<tr valign=\"top\">\n";
if ($withorig) {
if(isset($config['system']['usefifolog'])) {
$entry_date_time = htmlspecialchars(date("F j, Y, g:i a","" . $logent[1] . ""));
$entry_text = htmlspecialchars($logent[5]);
} else {
$entry_date_time = htmlspecialchars(join(" ", array_slice($logent, 0, 3)));
$entry_text = ($logent[3] == $config['system']['hostname']) ? "" : $logent[3] . " ";
$entry_text .= htmlspecialchars($logent[4] . " " . $logent[5]);
}
echo "<td class=\"listlr nowrap\">{$entry_date_time}</td>\n";
echo "<td class=\"listr\">{$entry_text}</td>\n";
} else {
echo "<td class=\"listlr\" colspan=\"2\">" . htmlspecialchars($logent[5]) . "</td>\n";
}
......@@ -575,13 +565,9 @@ function return_clog($logfile, $tail, $withorig = true, $grepfor = "", $grepinve
$grepline .= " | /usr/bin/egrep -v " . escapeshellarg(implode("|", $grepinvert));
if($config['system']['disablesyslogclog']) {
exec("cat " . escapeshellarg($logfile) . "{$grepline} | /usr/bin/tail {$sor} -n " . escapeshellarg($tail), $logarr);
} else {
if(isset($config['system']['usefifolog'])) {
exec("/usr/sbin/fifolog_reader " . escapeshellarg($logfile) . "{$grepline} | /usr/bin/tail {$sor} -n " . escapeshellarg($tail), $logarr);
} else {
exec("/usr/local/sbin/clog " . escapeshellarg($logfile) . "{$grepline}| grep -v \"CLOG\" | grep -v \"\033\" | /usr/bin/tail {$sor} -n " . escapeshellarg($tail), $logarr);
}
}
return($logarr);
}
......
......@@ -162,13 +162,8 @@ defCmdT("ipsec.conf","cat /usr/local/etc/ipsec.conf");
defCmdT("SPD","/sbin/setkey -DP");
defCmdT("SAD","/sbin/setkey -D");
if(isset($config['system']['usefifolog'])) {
defCmdT("last 200 system log entries","/usr/sbin/fifolog_reader /var/log/system.log 2>&1 | tail -n 200");
defCmdT("last 50 filter log entries","/usr/sbin/fifolog_reader /var/log/filter.log 2>&1 | tail -n 50");
} else {
defCmdT("last 200 system log entries","/usr/local/sbin/clog /var/log/system.log 2>&1 | tail -n 200");
defCmdT("last 50 filter log entries","/usr/local/sbin/clog /var/log/filter.log 2>&1 | tail -n 50");
}
defCmdT("last 200 system log entries","/usr/local/sbin/clog /var/log/system.log 2>&1 | tail -n 200");
defCmdT("last 50 filter log entries","/usr/local/sbin/clog /var/log/filter.log 2>&1 | tail -n 50");
defCmd("ls /conf");
defCmd("ls /var/run");
......
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