summaryrefslogtreecommitdiff
path: root/data/templates/rsyslog/logrotate.j2
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-07-16 22:03:06 +0200
committerChristian Breunig <christian@breunig.cc>2023-07-16 22:03:48 +0200
commit751d326c7769ac18db69de8f2be39587148be209 (patch)
tree7f28cee4f232094a0343713248922cfde48f5622 /data/templates/rsyslog/logrotate.j2
parenta7d26396ef7dd1f977221865e2345084bf9bcbef (diff)
downloadvyos-1x-751d326c7769ac18db69de8f2be39587148be209.tar.gz
vyos-1x-751d326c7769ac18db69de8f2be39587148be209.zip
syslog: T2778: fix invalid handling of logrotate and default values
There was no /var/log/messages handler for logrotate making rsyslog crash after a few days. In addition we had some JIna2 templating errors for hosts, user and file CLI nodes jinja2.exceptions.UndefinedError: 'dict object' has no attribute 'facility' Looks like therey are used rarely ;) - lucky me!
Diffstat (limited to 'data/templates/rsyslog/logrotate.j2')
-rw-r--r--data/templates/rsyslog/logrotate.j211
1 files changed, 11 insertions, 0 deletions
diff --git a/data/templates/rsyslog/logrotate.j2 b/data/templates/rsyslog/logrotate.j2
index 89d1a8a50..cc535c48f 100644
--- a/data/templates/rsyslog/logrotate.j2
+++ b/data/templates/rsyslog/logrotate.j2
@@ -1,4 +1,15 @@
### Autogenerated by system-syslog.py ###
+/var/log/messages {
+ missingok
+ notifempty
+ create
+ rotate 5
+ size=256k
+ postrotate
+ invoke-rc.d rsyslog rotate > /dev/null
+ endscript
+}
+
{% if file is vyos_defined %}
{% for file_name, file_options in file.items() %}
/var/log/user/{{ file_name }} {