1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

maillog not rotating - [SOLVED]

Discussion in 'Plesk for Linux - 8.x and Older' started by patrict, Sep 6, 2007.

  1. patrict

    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 :]