diff options
author | zsdc <taras@vyos.io> | 2021-12-17 16:41:50 +0200 |
---|---|---|
committer | zsdc <taras@vyos.io> | 2021-12-17 16:41:50 +0200 |
commit | 86bbab75ae414f19305970e2aa8aaeb05e6990ae (patch) | |
tree | 377b12e8f2672cf9ca9314bb8d7b261347c5f320 /data/templates/logs/logrotate/vyos-rsyslog.tmpl | |
parent | 945ab070b72ebd9f5ccfe0052ed138a93b83b297 (diff) | |
download | vyos-1x-86bbab75ae414f19305970e2aa8aaeb05e6990ae.tar.gz vyos-1x-86bbab75ae414f19305970e2aa8aaeb05e6990ae.zip |
logs: T3774: Optimization for logrotate configs
* Added proper handling of default values from CLI.
* Replaced rsyslog restart postrotate action to native `rsyslog-rotate`
script.
* Removed unnecessary checks for `None` instead `dict` - with
default values the situation becomes impossible.
* Fixed default value from 10 to 1 in the rsyslog CLI.
Diffstat (limited to 'data/templates/logs/logrotate/vyos-rsyslog.tmpl')
-rw-r--r-- | data/templates/logs/logrotate/vyos-rsyslog.tmpl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/data/templates/logs/logrotate/vyos-rsyslog.tmpl b/data/templates/logs/logrotate/vyos-rsyslog.tmpl index 3af1bfd8e..f2e4d2ab2 100644 --- a/data/templates/logs/logrotate/vyos-rsyslog.tmpl +++ b/data/templates/logs/logrotate/vyos-rsyslog.tmpl @@ -3,11 +3,11 @@ missingok nomail notifempty - rotate {{ rotate|default('10') }} - size {{ max_size|default('1') }}M + rotate {{ rotate }} + size {{ max_size }}M postrotate - # restart rsyslog service - systemctl restart rsyslog.service + # inform rsyslog service about rotation + /usr/lib/rsyslog/rsyslog-rotate endscript } |