Logrotate/svlogd not removing old logs in time
Summary
Old Logs won't get removed in time by logrotate/svlogd, because the logs aren't rotated every day
Steps to reproduce
Usage of GitLab, which doesn't generate enough logs, that logrotate/svlogd rotate them every day and thereby the last logfile is not 30 days old.
Example Project
not applicable
What is the current bug behavior?
Old logfiles won't be deleted after the desired time
What is the expected correct behavior?
The logrotate/svlogd should rotate empty logs as well, to ensure logfiles are removed after the default of 30 days or other desired value. This is important for us to ensure compliance with GDPR.
Relevant logs and/or screenshots
/var/log/gitlab/node-exporter# ll
insgesamt 68
drwx------ 2 gitlab-prometheus root 4096 Aug 19 10:36 ./
drwxr-xr-x 20 git root 4096 Aug 14 07:09 ../
-rwxr--r-- 1 root root 462 Mai 9 14:43 '@400000005cd420612d10facc.s'*
-rwxr--r-- 1 root root 505 Mai 15 14:43 '@400000005cdc0962156f1d2c.s'*
-rwxr--r-- 1 root root 503 Mai 20 10:36 '@400000005ce2671127831acc.s'*
-rwxr--r-- 1 root root 1995 Mai 29 09:45 '@400000005cee38b20353dc2c.s'*
-rwxr--r-- 1 root root 2492 Mai 31 09:45 '@400000005cf0dbb21162959c.s'*
-rwxr--r-- 1 root root 537 Jun 10 10:36 '@400000005cfe16a62177cd6c.s'*
-rwxr--r-- 1 root root 541 Jun 13 10:36 '@400000005d020b2636863e8c.s'*
-rwxr--r-- 1 root root 522 Jun 17 10:36 '@400000005d0751182110b6cc.s'*
-rwxr--r-- 1 root root 515 Jun 24 10:36 '@400000005d108b942cc2c35c.s'*
-rwxr--r-- 1 root root 498 Jul 1 10:36 '@400000005d19c6191360b374.s'*
-rwxr--r-- 1 root root 538 Jul 22 10:36 '@400000005d35759b20cca504.s'*
-rwxr--r-- 1 root root 534 Jul 29 10:36 '@400000005d3eb01335c3d11c.s'*
-rwxr--r-- 1 root root 1170 Aug 14 10:36 '@400000005d53c8152e247a24.s'*
-rwxr--r-- 1 root root 527 Aug 19 10:36 '@400000005d5a5f9b04f13c64.s'*
-rw-r--r-- 1 root root 30 Mai 7 14:42 config
-rw-r--r-- 1 root root 0 Aug 19 10:36 current
-rw------- 1 root root 0 Mai 7 14:43 lock
-rw-r--r-- 1 root root 0 Aug 19 10:36 state
Output of checks
#gitlab-ctl status
run: alertmanager: (pid 3177) 1396920s; run: log: (pid 3155) 1396921s
run: gitaly: (pid 3170) 1396920s; run: log: (pid 3146) 1396921s
run: gitlab-monitor: (pid 3165) 1396920s; run: log: (pid 3147) 1396921s
run: gitlab-workhorse: (pid 3169) 1396920s; run: log: (pid 3153) 1396921s
run: grafana: (pid 3176) 1396920s; run: log: (pid 3156) 1396921s
run: logrotate: (pid 16807) 107s; run: log: (pid 3143) 1396921s
run: node-exporter: (pid 3173) 1396920s; run: log: (pid 3144) 1396921s
run: postgres-exporter: (pid 3171) 1396920s; run: log: (pid 3152) 1396921s
run: postgresql: (pid 3167) 1396920s; run: log: (pid 3145) 1396921s
run: prometheus: (pid 3164) 1396920s; run: log: (pid 3151) 1396921s
run: redis: (pid 3174) 1396920s; run: log: (pid 3149) 1396921s
run: redis-exporter: (pid 3175) 1396920s; run: log: (pid 3154) 1396921s
run: sidekiq: (pid 3172) 1396920s; run: log: (pid 3148) 1396921s
run: unicorn: (pid 3166) 1396920s; run: log: (pid 3150) 1396921s
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Ubuntu 18.04 Proxy: no Current User: git Using RVM: no Ruby Version: 2.6.3p62 Gem Version: 2.7.9 Bundler Version:1.17.3 Rake Version: 12.3.2 Redis Version: 3.2.12 Git Version: 2.21.0 Sidekiq Version:5.2.7 Go Version: unknown
GitLab information Version: 12.1.6-ee Revision: d05ee0a9c12 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: PostgreSQL DB Version: 10.7 URL: https://gitlab.msu-intern.de HTTP Clone URL: https://gitlab.msu-intern.de/some-group/some-project.git SSH Clone URL: git@gitlab.msu-intern.de:some-group/some-project.git Elasticsearch: no Geo: no Using LDAP: yes Using Omniauth: no
GitLab Shell Version: 9.3.0 Repository storage paths:
- default: /opt/gitlab/data/git-data/repositories GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
Expand for output related to the GitLab application check
Checking GitLab subtasks ...
Checking GitLab Shell ...
GitLab Shell: ... GitLab Shell version >= 9.3.0 ? ... OK (9.3.0) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: OK Redis available via internal API: OK
Access to /var/opt/gitlab/.ssh/authorized_keys: OK gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Gitaly ...
Gitaly: ... default ... OK
Checking Gitaly ... Finished
Checking Sidekiq ...
Sidekiq: ... Running? ... yes Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Incoming Email ...
Incoming Email: ... Reply by email is disabled in config/gitlab.yml
Checking Incoming Email ... Finished
Checking LDAP ...
LDAP: ... Server: ldapmain LDAP authentication... Success LDAP users with access to your GitLab server (only showing the first 100 results) User output sanitized. Found 32 users of 100 limit.
Checking LDAP ... Finished
Checking GitLab App ...
Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... no Try fixing it: sudo chown -R git /var/opt/gitlab/gitlab-rails/uploads sudo find /var/opt/gitlab/gitlab-rails/uploads -type f -exec chmod 0644 {} ; sudo find /var/opt/gitlab/gitlab-rails/uploads -type d -not -path /var/opt/gitlab/gitlab-rails/uploads -exec chmod 0700 {} ; For more information see: doc/install/installation.md in section "GitLab" Please fix the error above and rerun the checks. Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... 4/1 ... yes 4/3 ... yes 7/4 ... yes 8/6 ... yes 9/8 ... yes 8/9 ... yes 9/11 ... yes 9/13 ... yes 9/14 ... yes 9/15 ... yes 8/16 ... yes 9/17 ... yes 9/18 ... yes 4/19 ... yes 9/20 ... yes 9/22 ... yes 9/23 ... yes 9/24 ... yes 9/25 ... yes 9/26 ... yes 9/28 ... yes 9/30 ... yes 9/31 ... yes 9/32 ... yes 8/34 ... yes 8/36 ... yes 8/37 ... yes 8/38 ... yes 11/39 ... yes 9/41 ... yes 9/42 ... yes 8/43 ... yes 8/44 ... yes 12/45 ... yes 12/46 ... yes 12/47 ... yes 12/48 ... yes 6/49 ... yes 12/50 ... yes 12/51 ... yes 4/54 ... yes 5/55 ... yes 4/56 ... yes 4/57 ... yes 4/58 ... yes 9/60 ... yes 9/61 ... yes 4/62 ... yes 4/63 ... yes 9/64 ... yes 8/65 ... yes 8/66 ... yes 8/67 ... yes 8/68 ... yes 8/69 ... yes 19/70 ... yes 8/71 ... yes 8/72 ... yes 8/73 ... yes 9/74 ... yes 8/75 ... yes 8/76 ... yes 9/82 ... yes 8/83 ... yes 9/85 ... yes 9/86 ... yes 9/87 ... yes 8/88 ... yes 9/89 ... yes 9/90 ... yes 9/91 ... yes 8/93 ... yes 8/94 ... yes 17/96 ... yes 22/97 ... yes 8/98 ... yes 8/99 ... yes 9/100 ... yes 9/101 ... yes 21/102 ... yes 21/103 ... yes 9/107 ... yes 9/108 ... yes 8/109 ... yes 8/110 ... yes 9/111 ... yes 21/112 ... yes 21/113 ... yes 23/114 ... yes 9/115 ... yes 21/116 ... yes 9/117 ... yes 9/118 ... yes 9/119 ... yes 9/120 ... yes 9/121 ... yes 9/123 ... yes 9/124 ... yes 9/125 ... yes 9/127 ... yes 9/128 ... yes 29/129 ... yes 9/130 ... yes 30/131 ... yes 29/132 ... yes 29/133 ... yes 9/135 ... yes 9/136 ... yes 9/137 ... yes 9/138 ... yes 9/139 ... yes 9/140 ... yes 21/141 ... yes 8/142 ... yes 9/143 ... yes 9/144 ... yes 9/145 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.5.3 ? ... yes (2.6.3) Git version >= 2.21.0 ? ... yes (2.21.0) Git user has default SSH configuration? ... yes Active users: ... 22 Elasticsearch version 5.6 - 6.x? ... skipped (elasticsearch is disabled)
Checking GitLab App ... Finished
Checking GitLab subtasks ... Finished