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
Submitted by JamieCameron on Sun, 03/05/2017 - 11:24 Comment #2
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?
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 lineinclude /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
Submitted by JamieCameron on Mon, 03/06/2017 - 21:50 Comment #4
Can you post the contents of that
/etc/logrotate.d/domain.com.conf
file to this bug report?