Log rotation stopped

Discussion in 'General' started by blinden, Jul 16, 2015.

  1. blinden

    blinden Member

    Ubuntu 14.04.2 LTS (Fully updated)
    ISPConfig 3.0.5.4p8

    I've made a couple threads in the last couple of days because I had kinda let the server get outdated a bit and did a lot of upgrades/updates yesterday, and it took a little bit of time to get everything working again. Now I'm looking through the servers and realized that on one of my servers in the cluster of 2 has stopped rotating the logs. In fact it stopped last October. Currently I have a few logs that are in the multiple GB of size. I've searched this forum up and down for information on this issue, and couldn't find much along the lines of anyone else having the problem..
    The output of crontab -l appears as:
    Code:
    * * * * * /usr/local/ispconfig/server/server.sh 2>&1 > /dev/null | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done
    30 00 * * * /usr/local/ispconfig/server/cron_daily.sh 2>&1 > /dev/null | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done
    
    I have a LOT of stuff in /var/log/ispconfig/cron.log, mostly mysql errors, for instance:
    Code:
    Wed Oct 22 23:26:07 EDT 2014 DB::__construct Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
    
    Wed Oct 22 23:26:07 EDT 2014 PHP Warning:  mysqli::mysqli(): (HY000/2002): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 72
    
    Wed Jul 15 16:26:54 EDT 2015 PHP Warning:  mysqli::escape_string(): Couldn't fetch db in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 228
    
    Wed Jul 15 16:26:54 EDT 2015 PHP Warning:  mysqli::close(): Couldn't fetch db in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 82
    
    Wed Jul 15 16:28:08 EDT 2015 PHP Warning:  mysqli::mysqli(): (HY000/2003): Can't connect to MySQL server on 'ispconfig.wpa.net' (113) in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 72
    
    Wed Jul 15 16:28:09 EDT 2015 DB::__construct Can't connect to MySQL server on 'ispconfig.wpa.net' (113)
    I'm still trying to trace through where the problem may be, but figured I may get there quicker if someone may point me in the right direction. I didn't make this thread when I saw the problem yesterday because I did an update of ISPConfig and thought that maybe after reconfigure the services it may fix itself, but it appears that it has not.
     
  2. blinden

    blinden Member

    So, picking this up this morning, I did notice looking at my /var/backup directory that I did indeed have a backup from the day it stopped working, so I must have done an ISPConfig update on that day. I'm trying to find differences in the files to see where the failure is. I currently feel like the issue is related to the SQL errors I'm seeing causing the process initiated by the daily cron to fail.

    I've unpacked the backup files from that date and I'm trying to compare them to the current files to see where the failure may be, but I haven't found any differences, mainly looking for differences in mysql host/user/pass configurations and such.

    update:
    Seeing the errors some to be related to connecting to the db, I manually entered the DB information into the file /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php since that's where the error messages are coming from. Not sure if I want to try to manually call the script manually at this time though.
     
    Last edited: Jul 17, 2015
  3. blinden

    blinden Member

    Back at this, I just tried to run the script manually /usr/local/ispconfig/server/cron_daily.sh, it definitely ran, took about 4 minutes to complete, gave me a message that says "finished" but no progress, the mail.log and syslog in /var/log did not rotate. It did not create any new data in the /var/log/ispconfig/cron.log
     
  4. florian030

    florian030 Well-Known Member HowtoForge Supporter

    cron_daily will not rotate / compress mail.log and syslog. You can do this with logrotated.
     

Share This Page