Logrotate & Roundcube

Hi all,

In some Ubuntu servers I noticed that logrotate fails to start. Tracking down the problem, I see this error:

Nov 02 23:57:33 [FQDN_Here] logrotate[1533746]: error: roundcube-core:3 duplicate log entry for /var/log/roundcube/errors.log
Nov 02 23:57:33 [FQDN_Here] logrotate[1533746]: error: found error in file roundcube-core, skipping
Nov 02 23:57:34 [FQDN_Here] systemd[1]: logrotate.service: Main process exited, code=exited, status=1/FAILURE

So I go to /etc/logrotate.d/ and notice there are two files: roundcube and roundcube-core with contents:

roundcube (newer):

/var/log/roundcube/*.log {
    rotate 12
    monthly
    missingok
    notifempty
    create 644 www-data www-data
}

roundcube-core (older)

# extension used for log filenames (default: ".log") is configurable
# with $config['log_file_ext'].
/var/log/roundcube/*.log
/var/log/roundcube/errors
/var/log/roundcube/sendmail
/var/log/roundcube/session
/var/log/roundcube/userlogins
{
  create 0640 www-data adm
  compress
  delaycompress
  missingok
  notifempty
  rotate 14
  daily
}

Searching the GitHub Repo, I see that only the first file should exist. I do not know how the second one came to be*. And the question is: Is it safe to delete the roundcube-core file?

Maybe the second file was created after running the command /usr/local/hestia/install/upgrade/manual/migrate_roundcube.sh ? (not saying, just guessing here)

Hi @Felix

No, it was not created by that script, but if you had to run that script is because you installed Roundcube using the package manager of your OS, and then yes, that package created the logrotate file roundcube-core

❯ apt-file search -x 'logrotate.*\/roundcube-core$'
roundcube-core: /etc/logrotate.d/roundcube-core

Yes.

Anyway, I’ve checked the issue and:

1.- The logrotate roundcube file is not added to /etc/logrotate.d/ neither by the install script nor the v-add-sys-roundcube command. So, that’s strange and I’ll take a look into it.

2.- The roundcube logrotate conf is not accurate, it uses the wrong owner. It should look like this:

/var/log/roundcube/*.log {
    rotate 12
    monthly
    missingok
    notifempty
    create 0640 hestiamail www-data
}

I’ll check it too.

2 Likes

I’ve created this PR:

2 Likes

You are a :gem_stone: Thank you! :raising_hands:

1 Like