Logrotate Error

Hi,

When disabling "log rotate" from the Virtualmin control panel (and via API) for a domain via Edit Virtual Server, then re-enabling it, Virtualmin spits back the error Log file rotation failed! : .. the log file /var/log/virtualmin/mydomain.com_access_log is already being rotated at ../web-lib-funcs.pl line 1427

It would appear Webmin is having troubles deleting the logrotate configuration for the domain upon disabling it via the admin or API.

*** As a temporary workaround, I simply delete the configuration file from /etc/logrotate.d folder for the given domain. This allows Webmin to properly re-create the configuration file and flag the feature as enabled inside Virtualmin. ***

-Peter

Status: 
Active

Comments

So is the underlying issue that when disabling the logrotate feature, the entry for the domain doesn't get removed from /etc/logrotate.conf ?

Do you get any error message in Virtualmin when disabling logrotate?

tpnsolutions's picture
Submitted by tpnsolutions on Sun, 03/05/2017 - 22:41

Jamie,

Yes, when disabling logrotate, it appears the file /etc/logrotate.d/domain.com.conf does NOT get removed.

*** Inside /etc/logrotate.conf there is a line include /etc/logrotate.d which tells logrotate to include all configurations from that directory. ***

When disabling logrotate from Virtualmin, there is NO error produced. There is however an error produced during the enable process, after a disable has been complete.

From what I've gathered, the logrotate configuration for the domain is NOT being removed, but Virtualmin thinks it has, hence it shows the feature as disabled afterward. When you then attempt to re-enable the feature, because the logrotate configuration exists, it won't allow Virtualmin to flag it as being enabled, and DOES spit back the error originally noted.

-Peter

Can you post the contents of that /etc/logrotate.d/domain.com.conf file to this bug report?