summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorJames Davidson <james.davidson@vyatta.com>2012-04-05 17:52:08 -0700
committerJames Davidson <james.davidson@vyatta.com>2012-04-18 11:04:44 -0700
commit2415dea5aa5ecc1542b3da7795c0b7c49b98f259 (patch)
tree75c34b1c20ebbcf0dec9689bbb702f116363cc26 /templates
parentf329c52b1d835aee551e2002e25937ed9447eb7d (diff)
downloadvyatta-cfg-system-2415dea5aa5ecc1542b3da7795c0b7c49b98f259.tar.gz
vyatta-cfg-system-2415dea5aa5ecc1542b3da7795c0b7c49b98f259.zip
Use rsyslog to trigger log rotation
The previous implementation of log rotation used an hourly cron job to check log file size and possibly perform a rotation. If the logging rate is high, this interval may allow for root file system space exhustion. Utilizing rsyslog's outchannel mechanism enables log rotation to be initiated as soon as the log file becomes larger than its configured size. Fixes Bug 7807.
Diffstat (limited to 'templates')
-rw-r--r--templates/system/syslog/file/node.tag/archive/files/node.def4
-rw-r--r--templates/system/syslog/file/node.tag/archive/node.def3
-rw-r--r--templates/system/syslog/file/node.tag/archive/size/node.def4
-rw-r--r--templates/system/syslog/global/archive/files/node.def4
-rw-r--r--templates/system/syslog/global/archive/node.def4
-rw-r--r--templates/system/syslog/global/archive/size/node.def4
-rw-r--r--templates/system/syslog/node.def2
7 files changed, 2 insertions, 23 deletions
diff --git a/templates/system/syslog/file/node.tag/archive/files/node.def b/templates/system/syslog/file/node.tag/archive/files/node.def
index 09eea916..bb60506c 100644
--- a/templates/system/syslog/file/node.tag/archive/files/node.def
+++ b/templates/system/syslog/file/node.tag/archive/files/node.def
@@ -3,7 +3,3 @@ type: u32
help: Number of saved files
default: 5
-
-update:
- sudo sh -c "/opt/vyatta/sbin/vyatta_update_logrotate.pl \
- '$VAR(../../@)' '$VAR(@)' '$VAR(../size/@)' 1"
diff --git a/templates/system/syslog/file/node.tag/archive/node.def b/templates/system/syslog/file/node.tag/archive/node.def
index 873cd0a6..0e7f6b3e 100644
--- a/templates/system/syslog/file/node.tag/archive/node.def
+++ b/templates/system/syslog/file/node.tag/archive/node.def
@@ -1,5 +1,4 @@
help: Log file size and rotation characteristics
delete:
- sudo sh -c "/opt/vyatta/sbin/vyatta_update_logrotate.pl \
- '$VAR(../@)' '$VAR(files/@)' '$VAR(size/@)' 0"
+ sudo rm -f "/opt/vyatta/etc/logrotate/file_$VAR(../@)"
diff --git a/templates/system/syslog/file/node.tag/archive/size/node.def b/templates/system/syslog/file/node.tag/archive/size/node.def
index f3e7e52f..0c9a1f7e 100644
--- a/templates/system/syslog/file/node.tag/archive/size/node.def
+++ b/templates/system/syslog/file/node.tag/archive/size/node.def
@@ -3,7 +3,3 @@ type: u32
help: Size of log files (kbytes)
default: 0
-
-update:
- sudo sh -c "/opt/vyatta/sbin/vyatta_update_logrotate.pl \
- '$VAR(../../@)' '$VAR(../files/@)' '$VAR(@)' 1"
diff --git a/templates/system/syslog/global/archive/files/node.def b/templates/system/syslog/global/archive/files/node.def
index d4e8af82..bb60506c 100644
--- a/templates/system/syslog/global/archive/files/node.def
+++ b/templates/system/syslog/global/archive/files/node.def
@@ -3,7 +3,3 @@ type: u32
help: Number of saved files
default: 5
-
-update:
- sudo sh -c "/opt/vyatta/sbin/vyatta_update_logrotate.pl \
- '$VAR(@)' '$VAR(../size/@)' 1"
diff --git a/templates/system/syslog/global/archive/node.def b/templates/system/syslog/global/archive/node.def
index 82bc9e86..2ec10727 100644
--- a/templates/system/syslog/global/archive/node.def
+++ b/templates/system/syslog/global/archive/node.def
@@ -1,5 +1 @@
help: Log file size and rotation characteristics
-
-delete:
- sudo sh -c "/opt/vyatta/sbin/vyatta_update_logrotate.pl \
- '$VAR(files/@)' '$VAR(size/@)' 0"
diff --git a/templates/system/syslog/global/archive/size/node.def b/templates/system/syslog/global/archive/size/node.def
index 341f4a5b..4d360a44 100644
--- a/templates/system/syslog/global/archive/size/node.def
+++ b/templates/system/syslog/global/archive/size/node.def
@@ -3,7 +3,3 @@ type: u32
help: Size of log files (kbytes)
default: 250
-
-update:
- sudo sh -c "/opt/vyatta/sbin/vyatta_update_logrotate.pl \
- '$VAR(../files/@)' '$VAR(@)' 1"
diff --git a/templates/system/syslog/node.def b/templates/system/syslog/node.def
index 81fb3f6c..ebe02232 100644
--- a/templates/system/syslog/node.def
+++ b/templates/system/syslog/node.def
@@ -1,5 +1,5 @@
priority: 400
help: System logging daemon
end: if /opt/vyatta/sbin/vyatta_update_syslog.pl; then
- sudo /usr/sbin/invoke-rc.d rsyslog restart
+ sudo /usr/sbin/invoke-rc.d rsyslog reload || sudo /usr/sbin/invoke-rc.d rsyslog restart
fi