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.

Configure cPanel Cron Jobs double entries since update to version 11.52.1.2

Discussion in 'General Discussion' started by chrisweb, Dec 7, 2015.

  1. chrisweb

    chrisweb Member

    Joined:
    Nov 18, 2014
    Messages:
    21
    Likes Received:
    2
    Trophy Points:
    3
    cPanel Access Level:
    Root Administrator
    Hello all, it’s like some crontab tasks has been doubled between users root and admin and something is wrong now but i don’t understand well enough things at these levels, so here is the complete timeline.

    To get into context, we have an admin user that is uid 0, as we understand this was not created by cPanel but by our data center when they did the initial setup of the server.

    Everything was fine with this, except since few weeks when the update to version 11.52.1.2 has been applied.

    Our upcp update script normaly runs at 4 :00 and we get the update log by email around 4 :05.

    Now it runs at 4 :00 and 6 :50 even if it is only setup to run at 4 :00 in « Configure cPanel Cron Jobs » and we receive the log email only after the one from 6 :50.

    I think i should do a manual cleanup of the crontabs and let the updates tasks to the root user but i am not sure if it is the right thing to do, if it can corrupt something else and if it is only patching the problem instead of solving it.

    Advices are welcome, thank you in advance!


    2015-11-23(updated to version 11.52.1.2)
    At 4 :05 received « Mail delivery failed: returning message to sender » email.

    2015-11-26(still on version 11.52.1.2)
    At 04 :00 received email « Cron <root@server-hostname> /usr/local/cpanel/scripts/upcp –cron » with the message « process is already running » instead of the complete update log.
    At 4 :05 received « Mail delivery failed: returning message to sender » email.
    At 06 :45 To make sure the update gets done i go into the cron jobs scheduler and set the update to run in few minutes at 06 :50.
    The update runs, at 06 :51 i receive the log email, everything looks ok, so i go back to the upcp config in « Configure cPanel Cron Jobs » and set back the update to run at 4 :00, hit save then logout.


    2015-11-27(still on version 11.52.1.2)
    At 04 :05 received « Mail delivery failed: returning message to sender » email, but no update log email.
    At 06 :55 received the update log email that we used to receive at 04 :05.

    I tought myself, weird, i had set it back to 04 :00, maybe it did not saved, so i log in to WHM and go to the « Configure cPanel Cron Jobs » to double check and i see 06 :50, but recveived emails at 04 :05 still.

    I set it back to 04 :00, hit save, go to some other page, come back to confirm that it is still set to 04 :00 and it is, then logout.


    2015-12-01 to this day
    At 04 :05 received « Mail delivery failed: returning message to sender » email, but no update log email.
    At 06 :55 received the update log email that we used to receive at 04 :05.


    I looked at the crontabs for users root and admin and see double entries at different times (i only kept the lines that were different).


    root user:
    Code:
    0 1 * * * /usr/local/cpanel/scripts/cpbackup
    34 5 * * * /usr/local/cpanel/whostmgr/docroot/cgi/cpaddons_report.pl --notify
    5,20,35,50 * * * * /usr/local/cpanel/whostmgr/bin/dnsqueue > /dev/null 2>&1
    0 2 * * * /usr/local/cpanel/bin/backup
    50 6 * * * /usr/local/cpanel/scripts/upcp --cron

    admin user:
    Code:
    29 23 * * * /usr/local/cpanel/whostmgr/docroot/cgi/cpaddons_report.pl --notify
    13,28,43,58 * * * * /usr/local/cpanel/whostmgr/bin/dnsqueue > /dev/null 2>&1
    0 4 * * * /usr/local/cpanel/scripts/upcp --cron
    0 1 * * * /usr/local/cpanel/bin/backup
    0 2 * * * /usr/local/cpanel/scripts/cpbackup

    Server infos and versions :
    CENTOS 6.7 x86_64 standard – WHM 11.52.1 (build 3)
    /etc/redhat-release:CentOS release 6.7 (Final)
    /usr/local/cpanel/version:11.52.1.3
    /var/cpanel/envtype:standard
    CPANEL=release
    Server version: Apache/2.2.29 (Unix)
    Server built: May 30 2015 05:59:01
    Cpanel::Easy::Apache v3.30.0 rev9999
    PHP 5.5.25 (cli) (built: May 30 2015 06:04:59)
    Copyright (c) 1997-2015 The PHP Group
    Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies
    mysql Ver 14.14 Distrib 5.5.46, for Linux (x86_64) using readline 5.1
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    649
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    I suggest removing any duplicate cron jobs, and then moving all cron jobs under the "admin" user to the "root" user. This will ensure the "root" cron jobs run as expected.

    Thank you.
     
    chrisweb likes this.
  3. chrisweb

    chrisweb Member

    Joined:
    Nov 18, 2014
    Messages:
    21
    Likes Received:
    2
    Trophy Points:
    3
    cPanel Access Level:
    Root Administrator
    Hello cPanelMichael, thank you for the reply.

    I cleaned up all the admin cron jobs since they were all duplicates from the root one.

    I will wait for this night/tomorrow morning to see the outcome and will let you know.

    Thank you for the help and have a nice day!
     
  4. chrisweb

    chrisweb Member

    Joined:
    Nov 18, 2014
    Messages:
    21
    Likes Received:
    2
    Trophy Points:
    3
    cPanel Access Level:
    Root Administrator
    Hello cPanelMichael, everything went ok with this morning update, no emails doubles, no error message email.
    I looked at the crontabs for users root and admin and everything is the same as yesterday.

    Then i updated the upcp time in WHM to test, because before it was not saving it well, and checked again the crontabs for users root and admin and everything is still ok, nothing in the admin's one and the upcp script runtime is updated well in the root's one.

    Thank you so much for the help and have a great day!
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    649
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  6. chrisweb

    chrisweb Member

    Joined:
    Nov 18, 2014
    Messages:
    21
    Likes Received:
    2
    Trophy Points:
    3
    cPanel Access Level:
    Root Administrator
    Hello again, I have to re-open this thread because the problem came back.
    Since 2016-02-07 I started getting double "admin has a uid 0 account" emails.
    I just took a look at admin and root users crontab and the daily update tasks are back again into the admin's one.
    Not all of them though, there are 2 missing.

    Here are the crontabs for these users.

    admin:
    Code:
    0 6 * * * /usr/local/cpanel/scripts/exim_tidydb > /dev/null 2>&1
    30 5 * * * /usr/local/cpanel/scripts/optimize_eximstats > /dev/null 2>&1
    51 3 * * * /usr/local/cpanel/scripts/upcp --cron
    0 1 * * * /usr/local/cpanel/scripts/cpbackup
    0 2 * * * /usr/local/cpanel/bin/backup
    35 * * * * /usr/bin/test -x /usr/local/cpanel/bin/tail-check && /usr/local/cpanel/bin/tail-check
    45 */4 * * * /usr/bin/test -x /usr/local/cpanel/scripts/update_mailman_cache && /usr/local/cpanel/scripts/update_mailman_cache
    30 */4 * * * /usr/bin/test -x /usr/local/cpanel/scripts/update_db_cache && /usr/local/cpanel/scripts/update_db_cache
    30 */2 * * * /usr/local/cpanel/bin/mysqluserstore >/dev/null 2>&1
    15 */2 * * * /usr/local/cpanel/bin/dbindex >/dev/null 2>&1
    15 */6 * * * /usr/local/cpanel/scripts/autorepair recoverymgmt >/dev/null 2>&1
    */5 * * * * /usr/local/cpanel/scripts/dcpumon-wrapper >/dev/null 2>&1
    31 3 * * * /usr/local/cpanel/whostmgr/docroot/cgi/cpaddons_report.pl --notify
    4,19,34,49 * * * * /usr/local/cpanel/whostmgr/bin/dnsqueue > /dev/null 2>&1
    root:
    Code:
    0 6 * * * /usr/local/cpanel/scripts/exim_tidydb > /dev/null 2>&1
    30 5 * * * /usr/local/cpanel/scripts/optimize_eximstats > /dev/null 2>&1
    0 1 * * * /usr/local/cpanel/scripts/cpbackup
    35 * * * * /usr/bin/test -x /usr/local/cpanel/bin/tail-check && /usr/local/cpanel/bin/tail-check
    45 */4 * * * /usr/bin/test -x /usr/local/cpanel/scripts/update_mailman_cache && /usr/local/cpanel/scripts/update_mailman_cache
    30 */4 * * * /usr/bin/test -x /usr/local/cpanel/scripts/update_db_cache && /usr/local/cpanel/scripts/update_db_cache
    30 */2 * * * /usr/local/cpanel/bin/mysqluserstore >/dev/null 2>&1
    15 */2 * * * /usr/local/cpanel/bin/dbindex >/dev/null 2>&1
    15 */6 * * * /usr/local/cpanel/scripts/autorepair recoverymgmt >/dev/null 2>&1
    */5 * * * * /usr/local/cpanel/scripts/dcpumon-wrapper >/dev/null 2>&1
    34 5 * * * /usr/local/cpanel/whostmgr/docroot/cgi/cpaddons_report.pl --notify
    5,20,35,50 * * * * /usr/local/cpanel/whostmgr/bin/dnsqueue > /dev/null 2>&1
    0 2 * * * /usr/local/cpanel/bin/backup
    2,58 * * * * /usr/local/bandmin/bandmin
    0 0 * * * /usr/local/bandmin/ipaddrmap
    0 4 * * * /usr/local/cpanel/scripts/upcp --cron
    Do you have an idea how these tasks got back into the admin user crontab?

    Thanks in advance!
     
  7. chrisweb

    chrisweb Member

    Joined:
    Nov 18, 2014
    Messages:
    21
    Likes Received:
    2
    Trophy Points:
    3
    cPanel Access Level:
    Root Administrator
    If that can be helpfull, I have compared the 2 users tasks and here is what comes out.
    I removed (from my comparison) the lines that were the same in both users.
    I put togheter the lines that were the same but at a different time, and I isolated the 2 lines that are in root crontab but not in admin's one.

    Here are the results.

    Same tasks, different times:
    Code:
    51 3 * * * /usr/local/cpanel/scripts/upcp --cron (admin)
    0 4 * * * /usr/local/cpanel/scripts/upcp --cron (root)
    
    31 3 * * * /usr/local/cpanel/whostmgr/docroot/cgi/cpaddons_report.pl --notify(admin)
    34 5 * * * /usr/local/cpanel/whostmgr/docroot/cgi/cpaddons_report.pl --notify (root)
    
    4,19,34,49 * * * * /usr/local/cpanel/whostmgr/bin/dnsqueue > /dev/null 2>&1(admin)
    5,20,35,50 * * * * /usr/local/cpanel/whostmgr/bin/dnsqueue > /dev/null 2>&1 (root)
    
    Only in root, not in admin:
    Code:
    2,58 * * * * /usr/local/bandmin/bandmin
    0 0 * * * /usr/local/bandmin/ipaddrmap
    
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    649
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Do you still have the "admin" user with UID 0? If so, I suggest disabling this custom configuration, as it can cause these types of issues, as mentioned on this post:

    Excessive resource usage: admin

    Thank you.
     
    chrisweb likes this.
  9. chrisweb

    chrisweb Member

    Joined:
    Nov 18, 2014
    Messages:
    21
    Likes Received:
    2
    Trophy Points:
    3
    cPanel Access Level:
    Root Administrator
    Hello cPanelMichael, thank you for the reply.

    Unfortunately yes, the admin uid is still 0, I did not had time to take care of this with system administrator yet.

    I will prioritize this.

    Thank you again and have a nice day!
     
Loading...

Share This Page