Page 1 of 1

Zimbra 8.7.11 logrotate in zimbra.log don't work

Posted: Wed Sep 13, 2017 6:57 pm
by wrcvidal
Hi Everyone,

I upgraded my enviroment from ubuntu 12.04 to ubuntu 16.04 (step via ubuntu 14.04). And Upgraded Zimbra, from 8.0.6 to 8.7.11 (not directly, first 8.0.last, 8.5, and 8.7.1 to 8.7.11).

The mail enviroment work's well. All fine, except the logrotate log to zimbra.log in /var/log, all another logs are rotating pure well.

I tried somany ways to configure /etc/logrotate.d/zimbra and /opt/zimbra/conf/zmlogrotate too.

There is someone that have zimbra 8.7.11 running in ubuntu 16.04 and that logrotate works fine?

My configuration now was this way:
root@mail:~# cat /etc/logrotate.d/zimbra
/var/log/zimbra.log {
daily
missingok
notifempty
rotate 100
create 0644 syslog adm
postrotate
/usr/sbin/service rsyslog restart >/dev/null || true
su - zimbra -c "/opt/zimbra/bin/zmswatchctl restart" > /dev/null 2>&1 || true
endscript
compress
}

/var/log/zimbra-stats.log {
daily
missingok
notifempty
create 0644 syslog adm
postrotate
/usr/sbin/service rsyslog restart >/dev/null || true
su - zimbra -c "/opt/zimbra/bin/zmlogswatchctl restart" > /dev/null 2>&1 || true
endscript
rotate 0
}
...

root@mail:~# cat /opt/zimbra/conf/zmlogrotate
/var/log/zimbra.log {
daily
missingok
notifempty
create 0644 syslog adm
postrotate
kill -HUP `cat /var/run/syslog*.pid 2> /dev/null` 2> /dev/null || true
su - zimbra -c "/opt/zimbra/bin/zmswatchctl restart" > /dev/null 2>&1 || true
endscript
compress
}

/var/log/zimbra-stats.log {
daily
missingok
notifempty
create 0644 syslog adm
postrotate
kill -HUP `cat /var/run/syslog*.pid 2> /dev/null` 2> /dev/null || true
su - zimbra -c "/opt/zimbra/bin/zmlogswatchctl restart" > /dev/null 2>&1 || true
endscript
rotate 0
}

When execute logrotate:
/usr/sbin/logrotate -dv /etc/logrotate.conf
...
rotating pattern: /var/log/zimbra.log after 1 days (100 rotations)
empty log files are not rotated, old logs are removed
switching euid to 0 and egid to 103
considering log /var/log/zimbra.log
log does not need rotating
switching euid to 0 and egid to 0

rotating pattern: /var/log/zimbra-stats.log after 1 days (no old logs will be kept)
empty log files are not rotated, old logs are removed
switching euid to 0 and egid to 103
considering log /var/log/zimbra-stats.log
log does not need rotating
switching euid to 0 and egid to 0
...

I tried run logrotate.d/zimbra too:
# /usr/sbin/logrotate -dv /etc/logrotate.d/zimbra
reading config file /etc/logrotate.d/zimbra

Handling 13 logs

rotating pattern: /var/log/zimbra.log after 1 days (100 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/zimbra.log
error: skipping "/var/log/zimbra.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.

rotating pattern: /var/log/zimbra-stats.log after 1 days (no old logs will be kept)
empty log files are not rotated, old logs are removed
considering log /var/log/zimbra-stats.log
error: skipping "/var/log/zimbra-stats.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.


There is "su" directive in the logrotate.conf:
root@mail:~# cat /etc/logrotate.conf
# see "man logrotate" for details
# rotate log files weekly
weekly

# use the syslog group by default, since this is the owning group
# of /var/log/syslog.
su root syslog


# keep 4 weeks worth of backlogs
rotate 30

# create new (empty) log files after rotating old ones
create

# uncomment this if you want your log files compressed
#compress

# packages drop log rotation information into this directory
include /etc/logrotate.d

# no packages own wtmp, or btmp -- we'll rotate them here
/var/log/wtmp {
missingok
monthly
create 0664 root utmp
rotate 1
}

/var/log/btmp {
missingok
monthly
create 0660 root utmp
rotate 1
}

The permission:
-rw-r--r-- 1 syslog adm 702M Sep 13 15:54 zimbra.log
-rw-r--r-- 1 syslog adm 1.1M Sep 13 15:54 zimbra-stats.log