Skip to content

[BUG] logrotate state file /var/lib/logrotate/state should be moved to "mail-state" persistent storage #3075

@IvanI3

Description

@IvanI3

Miscellaneous first checks

  • I checked that all ports are open and not blocked by my ISP / hosting provider.
  • I know that SSL errors are likely the result of a wrong setup on the user side and not caused by DMS itself. I'm confident my setup is correct.

Affected Component(s)

logrotate

What happened and when does this occur?

Currently "/var/lib/logrotate/state" placed to non-persistent directory, so after DMS container restarts, logrotates creates new "states" with boot time rotation timestamps for all logfiles.
So, if your, for example, restart DMS during a week, "weelky" logrotates will not occur at sunday.

What did you expect to happen?

I think log files shoud be rotated _every_ week at sunday, as it's configured. It should not depends on server reboots.
To do so, logrotate state directory must be placed at "/var/mail-state/lib-logrotate" and symlinked to "/var/lib/logrotate" same way as other persistent dirs.

How do we replicate the issue?

1. run in container: logrotate -d /etc/logrotate.conf
mention last log rotation dates
2. restart DMS contaiter
3. run in container again: logrotate -d /etc/logrotate.conf
/var/lib/logrotate/state file would be newly created, last rotation in it - the DMS boot time
4. weekly logrotate won't occur at next sunday

DMS version

v.11.3.1

What operating system is DMS running on?

Linux

Which operating system version?

Ubuntu 22.04

What instruction set architecture is DMS running on?

ARM64 / AArch64 (ARM v8 and newer)

What container orchestration tool are you using?

Kubernetes (not officially supported)

docker-compose.yml

No response

Relevant log output

No response

Other relevant information

No response

What level of experience do you have with Docker and mail servers?

  • I am inexperienced with docker
  • I am rather experienced with docker
  • I am inexperienced with mail servers
  • I am rather experienced with mail servers
  • I am uncomfortable with the CLI
  • I am rather comfortable with the CLI

Code of conduct

Improvements to this form?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions