Want more timely Centmin Mod News Updates?
Become a Member

Issue creating vhost option 22

Discussion in 'System Administration' started by enderst, Jan 10, 2019.

  1. enderst

    enderst New Member

    25
    5
    3
    Dec 12, 2017
    Ratings:
    +8
    Local Time:
    11:21 AM
    Anyone see centmin go nuts and fill the terminal with the following and won't stop until killed?
    calculated 137
    calculated 13
    318
    31
    calculated 318
    calculated 31
    307
    30
    calculated 307
    calculated 30
    256
    25
    calculated 256
    calculated 25
    211
    21
    calculated 211
    calculated 21
    202
    20
    calculated 202
    calculated 20
    242
    24
    calculated 242
    calculated 24
    111
    11
    calculated 111
    calculated 11
    226
    22
    calculated 226
    calculated 22
    134
    13
    calculated 134
    calculated 13
     
  2. eva2000

    eva2000 Administrator Staff Member

    40,620
    9,014
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,880
    Local Time:
    3:21 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    that's crazy - that only happens if you select centmin.sh menu option 22, or when you run centmin.sh itself ?

    tried updating centmin mod local code ? if on 123.09beta01 what is output for command
    Code (Text):
    cmupdate
    


    Please fill in any relevant information that applies to you:
    • CentOS Version: i.e. CentOS 6 32bit or 64bit / CentOS 7 64bit ?
    • Centmin Mod Version Installed: i.e. 123.08stable or 123.09beta01
    • Nginx Version Installed: i.e. 1.15.3
    • PHP Version Installed: i.e. 5.6.37, 7.0.31, 7.1.21, 7.2.9
    • MariaDB MySQL Version Installed: i.e. 10.0.x or 10.1.xx or 10.2.xx
    • When was last time updated Centmin Mod code base ? : i.e. run centmin.sh menu option 23 submenu option 2 or cmupdate command
    • Persistent Config: Do you have any persistent config file options set in /etc/centminmod/custom_config.inc ? You can check via this command:
      Code (Text):
      cat /etc/centminmod/custom_config.inc
      

      Post output in CODE tags.
     
  3. enderst

    enderst New Member

    25
    5
    3
    Dec 12, 2017
    Ratings:
    +8
    Local Time:
    11:21 AM
    123.09beta01
    Code:
    # cmupdate
    No local changes to save
    Already up-to-date.
    
    It happens during option 22 WP vhost creation:
    Code:
    ------------------------------------------------------------
    Created uninstall script
    /root/tools/wp_uninstall_domainname.com.sh
    ------------------------------------------------------------
    ------------------------------------------------------------
    Created wp_updater_domainname.com.sh script
    /root/tools/wp_updater_domainname.com.sh
    ------------------------------------------------------------
    273
    27
    242
    24
    calculated 242
    calculated 24
    282
    28
    calculated 282
    calculated 28
    270
    27
    calculated 270
    calculated 27
    222
    22
    calculated 222
    calculated 22
    370
    37
    calculated 370
    calculated 37
    222
    22
    calculated 222
    calculated 22
    
    Nothing has changed config wise, and I just created/migrated a site just before the issue.
    No issue creating a vhost using option 2 and the same domain name.
     
    style="display:inline-block;min-width:400px;max-width:970px;width:95%;height:90px" data-ad-client="ca-pub-6669518204467592" data-ad-slot="4024536743" data-ad-format="auto">
  4. eva2000

    eva2000 Administrator Staff Member

    40,620
    9,014
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,880
    Local Time:
    3:21 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x

    Troubleshooting Centmin Mod Menu Option 22 Wordpress Install Run



    To troubleshoot centmin.sh menu option 22 wordpress installation, you need to check the centmin.sh menu option 22 log located in /root/centminlogs at /root/centminlogs/centminmod_*_wordpress_addvhost.log based log where * is the centminmod version and date timestamp. Edit and mask any actual ftp username/password or wordpress usernames and logins before posting the log contents to Pastebin.com or Gists to share a sanitised version of the contents of the log.

    Example list /root/centminlogs files in date ascending order and grep for wordpress_addvhost.log
    Code (Text):
    ls -lahrt /root/centminlogs | grep wordpress_addvhost.log
    

    example output returns log at /root/centminlogs/centminmod_1.2.3-eva2000.09.001_111016-112321_wordpress_addvhost.log
    Code (Text):
    ls -lahrt /root/centminlogs | grep wordpress_addvhost.log
    -rw-r--r--  1 root root 2.2M Oct 11 01:40 /root/centminlogs/centminmod_1.2.3-eva2000.09.001_111016-112321_wordpress_addvhost.log
    

    in SSH use cat to ouput contents of /root/centminlogs/centminmod_1.2.3-eva2000.09.001_111016-112321_wordpress_addvhost.log. Clear your SSH client window/buffer so only output is the contents of the file
    Code (Text):
    cat /root/centminlogs/centminmod_1.2.3-eva2000.09.001_111016-112321_wordpress_addvhost.log
    

    Then copy and paste into Pastebin.com or Gists entry. If your SSH window scroll buffer isn't that large to get the whole contents of the install log, you can download file manually and copy and paste contents. But makes sure it's sanitised version of the contents without revealing sensitive info. For example you can replace domain name of the wordpress site with generic dummy entry = domain.com if you want and mask site/server IP revealed in the log with generic dummy entry = 111.222.333.444.
     
  5. enderst

    enderst New Member

    25
    5
    3
    Dec 12, 2017
    Ratings:
    +8
    Local Time:
    11:21 AM
    Was hoping the log would be helpful to me, but it ends just like the snippet i pasted. I'll sanitize and put it on pastebin. Will be a bit, 47 domains :)
     
  6. eva2000

    eva2000 Administrator Staff Member

    40,620
    9,014
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,880
    Local Time:
    3:21 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    but i see where that output is coming from, it's the routine that calculates the random seconds to launch the wordpress auto update cronjob
    Code (Text):
        # generate random number of seconds to delay cron start
        # making sure wp_updater for several wordpress nginx installs
        # do not run at very same time during cron scheduling
    

    on working test centmin.sh menu option 22 wordpress install it would be something like
    Code (Text):
    ------------------------------------------------------------
    Created uninstall script
    /root/tools/wp_uninstall_funky.domain.com.sh
    ------------------------------------------------------------
    ------------------------------------------------------------
    Created wp_updater_funky.domain.com.sh script
    /root/tools/wp_updater_funky.domain.com.sh
    ------------------------------------------------------------
    284
    28
    final 284
    final 28
    13 23 * * * /usr/local/src/centminmod/tools/autoprotect.sh >/dev/null 2>&1
    0 */4 * * * /usr/bin/cminfo_updater 2>/dev/null
    #*/15 * * * * sleep 227s ; wget -O - -q -t 1 http://funky.domain.com/wp-cron.php?doing_wp_cron > /dev/null 2>&1
    16 23 * * * echo "funky.domain.com cacheenabler cron"; sleep 958s ; rm -rf /home/nginx/domains/funky.domain.com/public/wp-content/cache/cache-enabler/* > /dev/null 2>&1
    0 */8 * * * sleep 284s ;/root/tools/wp_updater_funky.domain.com.sh >/dev/null 2>&1
    
    -------------------------------------------------------------
    

    cronjob for updater /root/tools/wp_updater_funky.domain.com.sh has random sleep of 284 calculated by the routine output above =284 and there's a secondary check that first 2 digits in 'sleep XXX' value are also not already in crontab -l output i.e. 28 as some crons would have 28 second sleep. The routine continues to loop until it finds a value for 3 digit and shorter 2 digit that doesn't already exist in crontab -l output of cronjobs.

    so i suspect you have ALOT of wordpress installs on this server so a lot of sleep XXX values populated for wordpress auto update cronjobs, so the routine is taking some time to loop through the routine to find a final random value to use for wordpress cronjob auto updater. It should eventually find a value if you wait long enough.

    you should be able to determine how many wordpress entries have sleep cronjobs via the command
    Code (Text):
    crontab -l | awk '/ sleep / {print $7}' | grep 's'
    

    ignore any domain name matches as grep 's' would of filtered on domains too
     
  7. eva2000

    eva2000 Administrator Staff Member

    40,620
    9,014
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,880
    Local Time:
    3:21 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    ok, think i found the solution you can try out manually first

    edit line 2517 of /usr/local/src/centminmod/inc/wpsetup.inc and change from
    Code (Text):
        while [[ "$(cat cronjoblist | awk '/ sleep / {print $7}' | grep "$DELAY_DUPCHECK")" ]]; do
    

    to
    Code (Text):
        while [[ "$(cat cronjoblist | awk '/ sleep / {print $7}' | grep -w "$DELAY_DUPCHECK")" ]] && [[ "$(cat cronjoblist | awk '/ sleep / {print $7}' | grep -w "$DELAY")" ]]; do
    

    which uses grep -w instead and checks both 2 digit sleep value in DELAY_DUPCHECK and 3 digit value in DELAY

    then try
     
    Last edited: Jan 11, 2019
  8. eva2000

    eva2000 Administrator Staff Member

    40,620
    9,014
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,880
    Local Time:
    3:21 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    actually updated the change in previous post
     
  9. enderst

    enderst New Member

    25
    5
    3
    Dec 12, 2017
    Ratings:
    +8
    Local Time:
    11:21 AM
    Pulled the latest with cmupdate and site 48 installed without issue. Thanks for jumping on this. Was wondering at the beginning if maybe there was a hard set site qty limit and I hit it. Was going to spin up another VM.
     
    • Like Like x 1
  10. eva2000

    eva2000 Administrator Staff Member

    40,620
    9,014
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,880
    Local Time:
    3:21 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    • Like Like x 1