Skip to content

Commit

Permalink
Fixes #10912: Duration of logrotate for /var/log/rudder/ is too long …
Browse files Browse the repository at this point in the history
…making /var/log too big
  • Loading branch information
peckpeck committed Nov 6, 2017
1 parent 8c5ef98 commit 8f2b863
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
11 changes: 11 additions & 0 deletions techniques/system/server-roles/1.0/logrotate-check.st
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ bundle agent root_logrotate_check
string => "reload",
policy => "overridable";

pass1.!duration_configured::
"logrotate_duration" string => "30";
pass1.duration_configured::
"logrotate_duration" string => "${rudder_parameters.log_duration}";

ubuntu::
"syslog_user" string => "syslog";

Expand All @@ -68,8 +73,14 @@ bundle agent root_logrotate_check

"syslog_rotation_method" string => "rotate";

classes:
"pass2" expression => "pass1";
"pass1" expression => "any";
"duration_configured" expression => isvariable("rudder_parameters.log_duration");

files:

pass2::
"/etc/logrotate.d/rudder"
create => "true",
edit_defaults => empty_backup,
Expand Down
10 changes: 5 additions & 5 deletions techniques/system/server-roles/1.0/rudder-logrotate.st
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/var/log/rudder/apache2/*.log {
daily
missingok
rotate 30
rotate ${root_logrotate_check.logrotate_duration}
compress
notifempty
create ${root_logrotate_check.syslog_file_mode} ${root_logrotate_check.syslog_user} ${root_logrotate_check.syslog_group}
Expand All @@ -23,7 +23,7 @@
/var/log/rudder/reports/*.log {
daily
missingok
rotate 30
rotate ${root_logrotate_check.logrotate_duration}
compress
notifempty
create ${root_logrotate_check.syslog_file_mode} ${root_logrotate_check.syslog_user} ${root_logrotate_check.syslog_group}
Expand All @@ -38,7 +38,7 @@
/var/log/rudder/reports/*.log {
daily
missingok
rotate 30
rotate ${root_logrotate_check.logrotate_duration}
compress
notifempty
create ${root_logrotate_check.syslog_file_mode} ${root_logrotate_check.syslog_user} ${root_logrotate_check.syslog_group}
Expand All @@ -53,7 +53,7 @@
/var/log/rudder/ldap/slapd.log {
daily
missingok
rotate 30
rotate ${root_logrotate_check.logrotate_duration}
compress
notifempty
create ${root_logrotate_check.syslog_file_mode} ${root_logrotate_check.syslog_user} ${root_logrotate_check.syslog_group}
Expand All @@ -67,7 +67,7 @@
/var/log/rudder/ldap/slapd.log {
daily
missingok
rotate 30
rotate ${root_logrotate_check.logrotate_duration}
compress
notifempty
create ${root_logrotate_check.syslog_file_mode} ${root_logrotate_check.syslog_user} ${root_logrotate_check.syslog_group}
Expand Down

0 comments on commit 8f2b863

Please sign in to comment.