Logrotate sets wrong permissions on log files

Solution Verified - Updated -

Issue

  • Logs are not created as specified in logrotate file.
  • /etc/logrotate.d/zimbra has setting as below:
/var/log/zimbra.log {
    daily
    missingok
    notifempty
    create 0644 zimbra zimbra  <============================= here
    postrotate
      kill -HUP `cat /var/run/syslog*.pid 2> /dev/null` 2> /dev/null || true
    endscript
    compress
}

However, logs created are 0600 root root as below:

-rw-------. 1 root root   233123 Oct  7 08:11 /var/log/zimbra.log
-rw-------. 1 root root    31149 Oct  4 03:10 /var/log/zimbra.log-20201004.gz
-rw-------. 1 root root    38753 Oct  5 03:20 /var/log/zimbra.log-20201005.gz
-rw-------. 1 root root   232520 Oct  6 03:08 /var/log/zimbra.log-20201006.gz
-rw-------. 1 root root   215349 Oct  7 03:07 /var/log/zimbra.log-20201007.gz

Environment

  • Red Hat Enterprise Linux 7.8
  • logrotate-3.8.6-19.el7.x86_64

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content