summaryrefslogtreecommitdiffstats
path: root/etc/rc
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2013-12-26 15:25:46 -0500
committerjim-p <jimp@pfsense.org>2013-12-26 15:27:40 -0500
commitc7a3356e6bfb67b1b617eaeddd5983ddae901759 (patch)
treee09ecd7c88d121c9c3559dc9fb39de73a9b87f8f /etc/rc
parent7b03748b37503e11fcb92075a375305fb06c9366 (diff)
downloadpfsense-c7a3356e6bfb67b1b617eaeddd5983ddae901759.zip
pfsense-c7a3356e6bfb67b1b617eaeddd5983ddae901759.tar.gz
Add a setting to allow the user to specify the clog file size so more (or less) entries may be kept in the raw logs. Retain previous default size values if the user has not specified a preferred size. Files can only be resized when initialized, so provide a "Reset All Logs" button as well to force clear all logs and set them up at the new size.
Diffstat (limited to 'etc/rc')
-rwxr-xr-xetc/rc10
1 files changed, 8 insertions, 2 deletions
diff --git a/etc/rc b/etc/rc
index 95b73b0..a1d6f81 100755
--- a/etc/rc
+++ b/etc/rc
@@ -301,6 +301,12 @@ echo -n "."
DISABLESYSLOGCLOG=`/usr/bin/grep -c disablesyslogclog /cf/conf/config.xml`
ENABLEFIFOLOG=`/usr/bin/grep -c usefifolog /cf/conf/config.xml`
LOG_FILES="system filter dhcpd vpn pptps poes l2tps openvpn portalauth ipsec ppp relayd wireless lighttpd ntpd gateways resolver routing"
+
+DEFAULT_LOG_FILE_SIZE=`/usr/local/bin/xmllint --xpath 'string(//pfsense/syslog/logfilesize)' /conf/config.xml`
+if [ ! ${DEFAULT_LOG_FILE_SIZE} ]; then
+ DEFAULT_LOG_FILE_SIZE=511488
+fi
+
for logfile in $LOG_FILES; do
if [ "$DISABLESYSLOGCLOG" -gt "0" ]; then
/usr/bin/touch /var/log/$logfile.log
@@ -308,9 +314,9 @@ for logfile in $LOG_FILES; do
if [ ! -f /var/log/$logfile.log ]; then
if [ "$ENABLEFIFOLOG" -gt "0" ]; then
# generate fifolog files
- /usr/sbin/fifolog_create -s 511488 /var/log/$logfile.log
+ /usr/sbin/fifolog_create -s ${DEFAULT_LOG_FILE_SIZE} /var/log/$logfile.log
else
- /usr/sbin/clog -i -s 512144 /var/log/$logfile.log
+ /usr/sbin/clog -i -s ${DEFAULT_LOG_FILE_SIZE} /var/log/$logfile.log
fi
fi
fi
OpenPOWER on IntegriCloud