The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Anacron job cron.daily

Discussion in 'Database Discussions' started by cgimickalo, Jan 9, 2014.

  1. cgimickalo

    cgimickalo Well-Known Member

    Joined:
    Apr 19, 2013
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    N.W. Iowa
    cPanel Access Level:
    Root Administrator
    I notice I just started getting these notices after the last Cpanel Stable update 11.40.01-9 when the daily cron runs:
    Code:
    /usr/bin/mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user 'root'@'localhost' (using password: NO)'
    error: error running non-shared postrotate script for /var/lib/mysql/mysql_slowquery.log of '/var/lib/mysql/mysql_slowquery.log '
    
    I don't have any problems connecting at the command line w/mysqladmin and the root my.cnf file is configured properly too. Any suggestion would be appreciated as how to fix this.

    Thanks,
     
  2. cPanelPeter

    cPanelPeter Technical Analyst III
    Staff Member

    Joined:
    Sep 23, 2013
    Messages:
    569
    Likes Received:
    15
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    You mentioned it was coming from the daily cron? I would check that first.
    You may have some plugin installed that is calling mysqladmin directly.

    # ls -al /etc/cron.daily
     
  3. cgimickalo

    cgimickalo Well-Known Member

    Joined:
    Apr 19, 2013
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    N.W. Iowa
    cPanel Access Level:
    Root Administrator
    no plug-ins installed that I know of. The cron.daily folder has been the same for some time this just started in the last couple of days.

    Mike
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    What specific cron jobs are you running in the /etc/cron.daily directory? Could you provide us with a list?

    Thank you.
     
  5. cgimickalo

    cgimickalo Well-Known Member

    Joined:
    Apr 19, 2013
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    N.W. Iowa
    cPanel Access Level:
    Root Administrator
    these are the files in the /etc/cron.daily folder:
    Code:
    logrotate*
    makewhatis.cron*
    mlocate.cron*
    prelink*
    readahead.cron*
    tmpwatch*
    
    one thing I did notice was the script modsecparse.pl was also in that folder, which it has been for some time and never caused any issues, I removed it and put it back in the /etc/cron.hourly folder. I believe the EasyApache puts it in there when it's run added Mod Security for Apache.

    Mike
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    The error is likely coming from the logrotate cron job based on the error message that you provided. Here is the content of that cron job on a test machine that I setup:

    Code:
    #!/bin/sh
    export TMPDIR=/var/spool/logrotate/tmp
    
    /usr/sbin/logrotate /etc/logrotate.conf >/dev/null 2>&1
    EXITVALUE=$?
    if [ $EXITVALUE != 0 ]; then
        /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
    fi
    exit 0
    You may want to review the same file on your system to see if any additional entries are used to connect to MySQL and rotate the MySQL slow query log.

    Thank you.
     
  7. cgimickalo

    cgimickalo Well-Known Member

    Joined:
    Apr 19, 2013
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    N.W. Iowa
    cPanel Access Level:
    Root Administrator
    That was one of the first things I checked before posting, for multiple instances rotating that log file, none was found but I will check again. I don't think that's the problem though.

    That is the same logrotate cron file I have in the /etc/cron.daily folder

    Mike
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Feel free to open a support ticket using the link in my signature so we can take a closer look. You can post the ticket number here so we can update this thread with the outcome.

    Thank you.
     
Loading...

Share This Page