Staging instance, all changes can be removed at any time

Skip to content

Adapt logrotate configuration so extra directory is also logrotated

On moma, the current logrotate stanza won't do anything:

root@moma:~# file /var/log/softwareheritage/webapp/swh-web.log
/var/log/softwareheritage/webapp/swh-web.log: ASCII text, with very long lines

And current size is a tad big:

root@moma:~# ls -lah /var/log/softwareheritage/webapp/swh-web.log
-rwxrwx--- 1 swhwebapp swhwebapp 5.7G Oct  5 07:13 /var/log/softwareheritage/webapp/swh-web.log

There is a warning icinga alert about it [1]:

02:01 <+swhbot`> icinga RECOVERY: service disk / on moma.softwareheritage.org is OK: DISK OK - free space: / 4452 MB (23% inode=86%);
  • [1] Noticed this week end but it's still a thing

Related to T3313

Test Plan

bin/octocatalog diff (on webapp nodes):

diff origin/production/webapp.internal.staging.swh.network current/webapp.internal.staging.swh.network
*******************************************
+ File[/etc/logrotate.d/swh-webapp] =>
   parameters =>
      "ensure": "file"
      "group": "swhwebapp"
      "mode": "0644"
      "owner": "swhwebapp"
      "content": >>>
# Software Heritage logrotate configuration
# Managed by puppet. Changes will be overwritten.

/var/log/softwareheritage/webapp/swh-web.log {
    weekly
    missingok
    rotate 5
    compress
    notifempty
    su swhwebapp swhwebapp
    postrotate
      kill -USR1 $(cat /var/run/gunicorn/swh-webapp/pidfile)
    endscript
}
<<<
*******************************************
*** End octocatalog-diff on webapp.internal.staging.swh.network

Migrated from D6407 (view on Phabricator)

Merge request reports

Loading