• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

maillog not rotating - [SOLVED]

P

patrict

Guest
Hi guys,

Thought I would share something with those that might have struggled as I did.

I noticed that my /usr/local/psa/var/log/maillog was not being rotated, even though I had the the /usr/local/psa/admin/sbin/statistics script running in the cron, which is responsible for doing the log rotation.

After lots of fruitless searching I could not come up with any solutions, so I ran the statistics script on my screen, and it reached a point where it crashed with a MySQL syntax error for one of my domains.

After investigation it turns out that the cause of the crash was that a user had created a database with dashes (-) in the name, and the database names all get stored in a table called data_bases in the psa database.

It appears that the statistics script reads the data_bases table, and crashes with a MySQL syntax error when one of the databases names has a dash in it.

I can only imagine the cause to be that the database name is not escaped in the MySQL statement (maybe something SWSoft can look into?).

To resolve the issue, I export the database, delete it, create a new database with a new name (with no dashes in!), and import the table structures and data again. This way the data_bases table in the psa database also gets updated with the new database name.

Once thats done just run the statistics script again and follow the above steps for any other crashes, until it completes successfully!

Hope this helps somebody :]
Patric
 
Back
Top