Get the most out of your Centmin Mod LEMP stack
Become a Member

Install nginx won't start autmatically after reboot?

Discussion in 'Install & Upgrades or Pre-Install Questions' started by modder, Jun 20, 2022.

  1. modder

    modder Member

    124
    16
    18
    Dec 6, 2019
    Ratings:
    +27
    Local Time:
    7:11 PM
    Please fill in any relevant information that applies to you:
    • CentOS Version: Vultr CentOS 7 64bit
    • Centmin Mod Version Installed: 130beta
    Now the nginx won't start automatically every time the server is booted up? I need to run ngxrestart / ngxstart to get it started...

     
  2. eva2000

    eva2000 Administrator Staff Member

    55,796
    12,271
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,857
    Local Time:
    9:11 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    The was a fix back on June 12, 2022 AEST that would of also fixed this issue if it's the same issue https://community.centminmod.com/threads/cron-error.22933/#post-93463

    Need more info at least output for
    Code (Text):
    cminfo versions


    Try these steps

    1. run this command and post output
    Code (Text):
    systemctl status nginx | egrep 'Loaded: |Drop-In: | Active: '
    


    2. run cmupdate command
    Code (Text):
    cmupdate


    3. run centmin.sh menu once and exit
    Code (Text):
    centmin


    4. reboot server

    5. after server is rebooted, run these commands and post the output for
    Code (Text):
    systemctl status nginx | egrep 'Loaded: |Drop-In: | Active: '
    

    example output
    Code (Text):
    systemctl status nginx | egrep 'Loaded: |Drop-In: | Active: '
       Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
      Drop-In: /etc/systemd/system/nginx.service.d
       Active: active (running) since Sun 2022-06-19 00:47:26 UTC; 14h ago
    
     
  3. modder

    modder Member

    124
    16
    18
    Dec 6, 2019
    Ratings:
    +27
    Local Time:
    7:11 PM
    Code (Text):
    1st:
    130.00beta01.b52 #Mon Jun  6 14:34:23 ABC 2022
    ..
    last 10:
    130.00beta01.b52 #Mon Jun  6 14:34:23 ABC 2022
    130.00beta01.b52 #Tue Jun  7 11:07:38 ABC 2022
    130.00beta01.b56 #Tue Jun  7 11:09:45 ABC 2022
    130.00beta01.b56 #Tue Jun  7 11:10:33 ABC 2022
    130.00beta01.b56 #Tue Jun  7 11:11:51 ABC 2022
    130.00beta01.b56 #Tue Jun  7 11:13:54 ABC 2022
    130.00beta01.b56 #Sat Jun 18 09:44:00 ABC 2022
    


    ABC = my time zone :)
     
  4. eva2000

    eva2000 Administrator Staff Member

    55,796
    12,271
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,857
    Local Time:
    9:11 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Yeah been quite a few updates in 130.00beta01 since b56 increment build. Currently on b90 increment for 130.00beta01. Good idea if you run info issues, to run cmupdate to check for Centmin Mod updates to your branch and then run centmin.sh once and exit to see if any updates apply.
     
  5. modder

    modder Member

    124
    16
    18
    Dec 6, 2019
    Ratings:
    +27
    Local Time:
    7:11 PM
    (reboot after cmupdate)

    Code (Text):
    # cminfo versions
    
    1st:
    130.00beta01.b52 #Mon Jun  6 14:34:23 ABC 2022
    ..
    last 10:
    130.00beta01.b52 #Mon Jun  6 14:34:23 ABC 2022
    130.00beta01.b52 #Tue Jun  7 11:07:38 ABC 2022
    130.00beta01.b56 #Tue Jun  7 11:09:45 ABC 2022
    130.00beta01.b56 #Tue Jun  7 11:10:33 ABC 2022
    130.00beta01.b56 #Tue Jun  7 11:11:51 ABC 2022
    130.00beta01.b56 #Tue Jun  7 11:13:54 ABC 2022
    130.00beta01.b56 #Sat Jun 18 09:44:00 ABC 2022
    130.00beta01.b90 #Sun Jun 19 23:53:58 ABC 2022
    130.00beta01.b90 #Sun Jun 19 23:54:57 ABC 2022


    Code (Text):
    # systemctl status nginx | egrep 'Loaded: |Drop-In: | Active: '
       Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: disabled)
      Drop-In: /etc/systemd/system/nginx.service.d
       Active: inactive (dead)


    ngxstart

    Code (Text):
    # systemctl status nginx | egrep 'Loaded: |Drop-In: | Active: '
       Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: disabled)
      Drop-In: /etc/systemd/system/nginx.service.d
       Active: active (running) since Mon 2022-06-20 00:04:57 ABC; 2s ago


    after another reboot, the nginx is still not started.

    (The terminal didn't prompt me for cmupdate before so I thought it's the latest version.)
     
  6. eva2000

    eva2000 Administrator Staff Member

    55,796
    12,271
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,857
    Local Time:
    9:11 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    interesting it's still reporting as disabled for Loaded: line
    Code (Text):
    /usr/lib/systemd/system/nginx.service; disabled
    

    the fix on centmin.sh menu run should automatically run the command to enable nginx systemd service to start on reboot. Manually you can run the command too
    Code (Text):
    systemctl enable nginx
    

    then
    Code (Text):
    systemctl status nginx | egrep 'Loaded: |Drop-In: | Active: '
    

    should report it as
    Code (Text):
    systemctl status nginx | egrep 'Loaded: |Drop-In: | Active: '
       Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled
    

    will have to look into this
     
  7. modder

    modder Member

    124
    16
    18
    Dec 6, 2019
    Ratings:
    +27
    Local Time:
    7:11 PM
    Yes I use the commands provided by you and now it can auto start. Thank you.
     
  8. eva2000

    eva2000 Administrator Staff Member

    55,796
    12,271
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,857
    Local Time:
    9:11 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  9. modder

    modder Member

    124
    16
    18
    Dec 6, 2019
    Ratings:
    +27
    Local Time:
    7:11 PM
    do you want to login to my another server? it's a pretty new server with latest centmin 130 beta installed by the command you provided in the installation guide.

    I can PM you the login if you think it helps.
     
  10. eva2000

    eva2000 Administrator Staff Member

    55,796
    12,271
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,857
    Local Time:
    9:11 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    the other server also shows systemctl nginx status disabled ?
     
  11. modder

    modder Member

    124
    16
    18
    Dec 6, 2019
    Ratings:
    +27
    Local Time:
    7:11 PM
    yes, even after i've just updated it to b90.
     
  12. modder

    modder Member

    124
    16
    18
    Dec 6, 2019
    Ratings:
    +27
    Local Time:
    7:11 PM
    Is it a good idea to install 130 beta version for my production server?
     
  13. eva2000

    eva2000 Administrator Staff Member

    55,796
    12,271
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,857
    Local Time:
    9:11 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    130.00beta01 is subject to faster changes/newer feature additions so yes it can introduce bugs. But as I mainly run 130.00beta01 myself for testing even in production, if I run into bugs they should usually be fixed quickly. FYI, just updated 130.00beta01 with more checks to ensure services like nginx start on reboot of server. It should fix the issue on your other server with cmupdate command + run centmin.sh once
     
  14. modder

    modder Member

    124
    16
    18
    Dec 6, 2019
    Ratings:
    +27
    Local Time:
    7:11 PM
    cmupdate that updated to 130.00beta01.b93
    After reboot, the web server auto started.

    And thanks for giving me the faith in keep using 130beta on my development/production servers.

    (You didn't sleep?! )
     
  15. eva2000

    eva2000 Administrator Staff Member

    55,796
    12,271
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,857
    Local Time:
    9:11 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Not yet! Latest updates also fixed 130.00beta01 out of the box confirmed Nginx status that it's enabled https://community.centminmod.com/th...00beta01-install-time-stats.22727/#post-93590

    Code (Text):
     nginx.service - Centmin Mod NGINX Server
       Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
      Drop-In: /etc/systemd/system/nginx.service.d
               └─failure-restart.conf, openfileslimit.conf
       Active: active (running) since Sun 2022-06-19 23:08:00 UTC; 12s ago
     Main PID: 7743 (nginx)
       CGroup: /system.slice/nginx.service
               ├─7743 nginx: master process /usr/local/sbin/nginx -c /usr/local/nginx/conf/nginx.con
               ├─7744 nginx: worker process                                  
               └─7745 nginx: worker process