• The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Resolved /usr/local/psa/var/log/maillog not rotated.

Hello,

You can check the below article to enable Logrotation .

https://docs.plesk.com/en-US/12.5/a...linux/statistics-and-logs/log-rotation.68648/

You can set the following parameters of logs rotation:

Log rotation condition. This may be one of the following:
Size - Plesk rotates logs when their size exceeds a particular limit.
Time - daily, weekly, or monthly logs rotation.
Maximum number of log files.
Log compression. Enable this, if you want Plesk to compress log files to gzip archives.
Email to which Plesk should send processed log files.

Regards,
 
Problem.
I added to /usr/local/psa/etc/logrotate.conf these lines:

/usr/local/psa/var/log/maillog {
missingok
rotate 3
size 100M
compress
}

Some time later /usr/local/psa/etc/logrotate.conf is rotated successfully,
BUT logs are no longer being written in /usr/local/psa/var/log/maillog
(/usr/local/psa/var/log/maillog does not exist or is always empty).
 
When you rotate the log file, the old log file gets deleted, but as the daemon of the service is still running, it still has the old file handle in RAM and tries to write log data to that yet unclosed file handle. As the file no longer exists, the daemon cannot write new data to the file.

The solution to this issue is to add a "postrotate" command to the log rotation definition that restarts the daemon. What to do exactly depends on the mail server and operating system you are using. If you have a service rsyslog running, likely these two lines will do:

Code:
postrotate
       service rsyslog restart

As an alternative use this:
Code:
postrotate
        /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
 
Back
Top