Discover Centmin Mod today
Register Now

Checking for yum updates every time you exit

Discussion in 'Other Centmin Mod Installed software' started by BamaStangGuy, Feb 8, 2018.

  1. BamaStangGuy

    BamaStangGuy Active Member

    531
    161
    43
    May 25, 2014
    Ratings:
    +214
    Local Time:
    5:03 AM
    Can this be disabled or moved to an option? Sometimes it just sits there for well over a minute, if not longer than 2 minutes hanging before it finally does something.

    This adds up if you are working on a new server and constantly inside centmin.sh
     
  2. eva2000

    eva2000 Administrator Staff Member

    36,054
    7,910
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,192
    Local Time:
    8:03 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    • Maybe you have slow yum mirrors ? Tried
      Code (Text):
      yum clean all
    • Do you get hangs on initial login to server as well?
    • Do you get hangs when you initially run centmin.sh as well?
    • When there's hangs on centmin.sh menu exit, are there actually yum updates available or no updates listed? If there's a correlation with hangs and having yum package updates available and listed, then one way to minimise the problem is to setup yum-cron for automatically nightly updates as then the chances of having package updates detected on centmin.sh menu exit are lessened due to yum-cron already having installed the updates Automatic nightly YUM updates with yum-cron
    You can try running centmin.sh menu option 24 in debug mode logged to debug.txt text file in /root/centminlogs directory by running these 3 commands paying attention on 2nd command's run as to what text is displayed on the screen during any hangs you may experience.
    Code (Text):
    cd /usr/local/src/centminmod
    echo 24 | bash -x centmin.sh 2>&1 | awk '{ print strftime("%Y-%m-%d %H:%M:%S"), $0; fflush(); }' | tee /root/centminlogs/debug.txt && echo "debug log saved at /root/centminlogs/debug.txt"
    sed -i "s|$(hostname)|hostname|g" /root/centminlogs/debug.txt
    

    Then copy the contents of /root/centminlogs/debug.txt into a pastebin.com or gist.github.com shared link - with an sensitive info masked. At least server hostname will be replaced with word hostname instead via last sed replacement line.
     
  3. pamamolf

    pamamolf Well-Known Member

    3,113
    295
    83
    May 31, 2014
    Ratings:
    +530
    Local Time:
    1:03 PM
    Nginx-1.13.x
    MariaDB 10.1.x
    For me it takes a few seconds as needed.....

    Do you have the same delay when you manually check for updateds?

    Maybe some dns issues?
     
  4. Jon Snow

    Jon Snow Active Member

    374
    60
    28
    Jun 30, 2017
    Ratings:
    +90
    Local Time:
    7:03 AM
    Nginx 1.13.9
    MariaDB 10.1.31
    Same here.
     
  5. Sunka

    Sunka Well-Known Member

    1,003
    276
    83
    Oct 31, 2015
    Rijeka, Croatia
    Ratings:
    +453
    Local Time:
    12:03 PM
    Nginx 1.15.0
    MariaDB 10.2.15
    10-15 seconds here
     
  6. eva2000

    eva2000 Administrator Staff Member

    36,054
    7,910
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,192
    Local Time:
    8:03 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    using above 3 commands, longest part for me is ~13 seconds for yum check-update which is normal
    Code (Text):
    2018-02-08 21:53:16 + echo ' checking for YUM updates... please wait...'
    2018-02-08 21:53:16  checking for YUM updates... please wait...
    2018-02-08 21:53:16 + [[ -f /etc/yum.repos.d/remi.repo ]]
    2018-02-08 21:53:16 ++ /usr/bin/yum --disableplugin=priorities,versionlock -e 0 -d 0 check-update --enablerepo=remi,city-fan.org '--exclude=nginx* php* mysql*'
    2018-02-08 21:53:29 ++ echo 100
    2018-02-08 21:53:29 + UPDATE_CHECK=100
    

    if you don't use varnish cache, you can disable the varnish repo to speed up the check
    Code (Text):
    yum-config-manager --disable varnishcache_varnish41 varnishcache_varnish41-source | grep enabled
    

    ~4 seconds with varnish repo disabled
    Code (Text):
    2018-02-08 21:57:25 + echo ' checking for YUM updates... please wait...'
    2018-02-08 21:57:25  checking for YUM updates... please wait...
    2018-02-08 21:57:25 + [[ -f /etc/yum.repos.d/remi.repo ]]
    2018-02-08 21:57:25 ++ /usr/bin/yum --disableplugin=priorities,versionlock -e 0 -d 0 check-update --enablerepo=remi,city-fan.org '--exclude=nginx* php* mysql*'
    2018-02-08 21:57:29 ++ echo 100
    2018-02-08 21:57:29 + UPDATE_CHECK=100
    
     
  7. pamamolf

    pamamolf Well-Known Member

    3,113
    295
    83
    May 31, 2014
    Ratings:
    +530
    Local Time:
    1:03 PM
    Nginx-1.13.x
    MariaDB 10.1.x
    Yes i have it also disabled :)
     
  8. BamaStangGuy

    BamaStangGuy Active Member

    531
    161
    43
    May 25, 2014
    Ratings:
    +214
    Local Time:
    5:03 AM
    Disabling Varnish check has made it much more bearable.
     
    • Like Like x 1
  9. eva2000

    eva2000 Administrator Staff Member

    36,054
    7,910
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,192
    Local Time:
    8:03 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    how much better time wise ?
     
  10. Varun

    Varun Premium Member Premium Member

    36
    2
    8
    Apr 6, 2018
    India, Tamil Nadu, Chennai
    Ratings:
    +3
    Local Time:
    3:33 PM
    1.13.11
  11. eva2000

    eva2000 Administrator Staff Member

    36,054
    7,910
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,192
    Local Time:
    8:03 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    @Varun was generating the debug log run slow like before or relatively faster ? I ask as the debug run only saw ~5 second delay for yum check part
    Code (Text):
    2018-04-12 02:47:38 + echo ' checking for YUM updates... please wait...'
    2018-04-12 02:47:38  checking for YUM updates... please wait...
    2018-04-12 02:47:38 + [[ -f /etc/yum.repos.d/remi.repo ]]
    2018-04-12 02:47:38 ++ /usr/bin/yum --disableplugin=priorities,versionlock -e 0 -d 0 check-update --enablerepo=remi '--exclude=nginx* php* mysql*'
    2018-04-12 02:47:43 ++ echo 1
    2018-04-12 02:47:43 + UPDATE_CHECK=1
    2018-04-12 02:47:43 + [[ 1 = \1\0\0 ]]
    2018-04-12 02:47:43 + echo ' no YUM updates available'
    2018-04-12 02:47:43  no YUM updates available

    Has subsequent centmin.sh menu option 24 exits been as slow or are all of them subsequent ones relatively fast too ?

    edit: i think i know what happened specifically with your slow exist, i updated 123.09beta01 to skip varnish cache repo setup if the response time or connection to packagecloud.io varnish cache url has issues and also moved the varnish cache repo packagecloud.io GPG key setup as part of varnish cache repo setup was delayed until after initial install. So on fresh centmin mod 123.09beta01, it seems the first time you use yum, the importing of varnish cache GPG key happened. Was this first time you exited centmin.sh menu after initial install when you got slowness ?

    I just experienced this myself when - the latter part of GPG key setup when testing cminfo listlog command
    Code (Text):
    cminfo listlogs
    Importing GPG key 0xCBF5C49E:
     Userid     : "https://packagecloud.io/varnishcache/varnish41 (https://packagecloud.io/docs#gpg_signing) <[email protected]>"
     Fingerprint: 9c96 f9ca 0dc3 f4ea 78ff 3328 34bf 6e8e cbf5 c49e
     From       : https://packagecloud.io/varnishcache/varnish41/gpgkey
    Importing GPG key 0xCBF5C49E:
     Userid     : "https://packagecloud.io/varnishcache/varnish41 (https://packagecloud.io/docs#gpg_signing) <[email protected]>"
     Fingerprint: 9c96 f9ca 0dc3 f4ea 78ff 3328 34bf 6e8e cbf5 c49e
     From       : https://packagecloud.io/varnishcache/varnish41/gpgkey
    
    List all /root/centminlogs in data ascending order
    total 7.1M
    -rw-r--r-- 1 root root  15K Apr 10 18:32 centminmod_123.09beta01.b017_100418-183159_yuminstall_centos7.log
    -rw-r--r-- 1 root root  16K Apr 10 18:32 centminmod_yumtimes_100418-183159.log
    -rw-r--r-- 1 root root   37 Apr 10 18:32 centminmod_profiletimes_100418-183159.log
    -rw-r--r-- 1 root root 2.2K Apr 10 18:33 cmm-login-git-checks_100418-183305.log
    -rw-r--r-- 1 root root  81K Apr 10 18:33 centminmod_downloadtimes_100418-183159.log
    -rw-r--r-- 1 root root  270 Apr 10 18:33 securedtmp.log
    -rw-r--r-- 1 root root    0 Apr 10 18:33 patch_opensslpatches_100418-183159.log
    -rw-r--r-- 1 root root   45 Apr 10 18:36 centminmod_opensslinstalltime_100418-183159.log
    -rw-r--r-- 1 root root    8 Apr 10 18:36 patch_patchnginx_100418-183159.log
    -rw-r--r-- 1 root root 1.6K Apr 10 18:37 gcc_native.log
    -rw-r--r-- 1 root root 1.5K Apr 10 18:37 nginx-configure-100418-183159.log
    -rw-r--r-- 1 root root 2.7M Apr 10 18:40 centminmod_ngxinstalltime_100418-183159.log
    -rw-r--r-- 1 root root 9.4K Apr 10 18:42 setio_innodbstatus-before-100418-184230.log
    -rw-r--r-- 1 root root  785 Apr 10 18:42 centminmod_setio_100418-184230.log
    -rw-r--r-- 1 root root 9.4K Apr 10 18:42 setio_innodbstatus-after-100418-184230.log
    -rw-r--r-- 1 root root 1.8K Apr 10 18:43 gcc_php_native.log
    -rw-r--r-- 1 root root   58 Apr 10 18:48 centminmod_phpinstalltime_100418-183159.log
    -rw-r--r-- 1 root root  496 Apr 10 18:48 zendopcache_passfile.txt
    -rw-r--r-- 1 root root  33K Apr 10 18:53 centminmod_123.09beta01.b017_100418-183159_yum-log.log
    -rw-r--r-- 1 root root  125 Apr 10 18:53 install.utc.time.log
    -rw-r--r-- 1 root root 4.2M Apr 10 18:53 centminmod_123.09beta01.b017_100418-183159_install.log
    dr-xr-x--- 7 root root 4.0K Apr 10 18:53 ..
    -rw-r--r-- 1 root root   19 Apr 10 18:53 getcmtime_installtime_100418-182604.log
    -rw-r--r-- 1 root root   56 Apr 10 18:53 firstyum_installtime_100418-182604.log
    -rw-r--r-- 1 root root  808 Apr 10 18:53 install_time_stats_100418-182604.log
    -rw-r--r-- 1 root root 5.1K Apr 10 18:53 sar-u-installstats.log
    -rw-r--r-- 1 root root 4.6K Apr 10 18:53 sar-q-installstats.log
    -rw-r--r-- 1 root root 7.0K Apr 10 18:53 sar-r-installstats.log
    -rw-r--r-- 1 root root 4.0K Apr 10 18:53 sar-b-installstats.log
    -rw-r--r-- 1 root root 2.4K Apr 10 18:53 yum-timedhosts.txt
    drwxr-xr-x 2 root root 4.0K Apr 12 05:27 .
    -rw-r--r-- 1 root root 2.2K Apr 12 05:27 cmm-login-git-checks_120418-052716.log
    

    the GPG key import setup is a one time task so subsequent yum commands should not have issues.
     
  12. eva2000

    eva2000 Administrator Staff Member

    36,054
    7,910
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,192
    Local Time:
    8:03 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    FYI for convenience a centmin mod 123.09beta01 cminfo update allows for doing debug-menuexit log run which is the more convenient automated way of running the manual debug centmin.sh menu option 24 cmds at Checking for yum updates every time you exit. Used for debugging slow centmin.sh menu 24 exits saving a debug log to /root/centminlogs/debug-menuexit.txt and calculating the yum check time/duration.
    Code (Text):
    cminfo debug-menuexit
    
    ------------------------------------------------------------------
    Debugging centmin.sh menu option 24 exit routine starting
    Please wait until complete...
    ------------------------------------------------------------------
    Full debug log saved at /root/centminlogs/debug-menuexit.txt
    
    Inspect Yum Check Times In debug-menuexit.txt log
    
    2018-04-12 06:36:59 + echo ' checking for YUM updates... please wait...'
    2018-04-12 06:36:59  checking for YUM updates... please wait...
    2018-04-12 06:36:59 + [[ -f /etc/yum.repos.d/remi.repo ]]
    2018-04-12 06:36:59 ++ /usr/bin/yum --disableplugin=priorities,versionlock -e 0 -d 0 check-update --enablerepo=remi '--exclude=nginx* php* mysql*'
    2018-04-12 06:37:33 ++ echo 100
    2018-04-12 06:37:33 + UPDATE_CHECK=100
    2018-04-12 06:37:33 + [[ 100 = \1\0\0 ]]
    
    Yum Check Duration: 34.00 seconds
    
    ------------------------------------------------------------------
    Debugging centmin.sh menu option 24 exit routine completed
    ------------------------------------------------------------------
     
    • Like Like x 1
..