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

Nginx Nginx restart short command doesn't work.

Discussion in 'Bug Reports' started by Mike Guista, Mar 12, 2025.

  1. Mike Guista

    Mike Guista New Member

    25
    10
    3
    Sep 15, 2014
    Ratings:
    +10
    Local Time:
    8:54 PM
    1.7.6
    10.x
    Hi,


    The shortcode for restarting nginx doesn't work. When I am trying the command nprestart, I'm getting the following error message;

    /usr/bin/nprestart: line 1: service: command not found

    Please fill in any relevant information that applies to you:
    • AlmaLinux 9
    • Centmin Mod Version Installed: i.e. 124.00stable or 130.00beta01 or 131.00stable or 140.00beta01. Run command:
      Code (Text):
      cminfo versions
    • Nginx Version Installed: 1.27.4
      Code (Text):
      nginx version: nginx/1.27.4 (180225-204816-almalinux8-kvm-9d823c6-br-a71f931)
      built by gcc 13.3.1 20240611 (Red Hat 13.3.1-2) (GCC)
      built with OpenSSL 1.1.1k  FIPS 25 Mar 2021
      TLS SNI support enabled
      configure arguments: --with-ld-opt='-Wl,-E -L/usr/local/zlib-cf/lib -L/usr/local/nginx-dep/lib -ljemalloc -Wl,-z,relro,-z,now -Wl,-rpath,/usr/local/zlib-cf/lib:/usr/local/nginx-dep/lib -pie -fuse-ld=gold' --with-cc-opt='-I/usr/local/zlib-cf/include -I/usr/local/nginx-dep/include -m64 -march=x86-64 -mavx -mavx2 -mpclmul -msse4 -msse4.1 -msse4.2 -fPIC -g -O3 -fstack-protector-strong -fuse-ld=gold --param=ssp-buffer-size=4 -Wformat -Wno-pointer-sign -Wimplicit-fallthrough=0 -Wno-cast-align -Wno-implicit-function-declaration -Wno-builtin-declaration-mismatch -Wno-deprecated-declarations -Wno-int-conversion -Wno-unused-result -Wno-vla-parameter -Wno-maybe-uninitialized -Wno-return-local-addr -Wno-array-parameter -Wno-alloc-size-larger-than -Wno-address -Wno-array-bounds -Wno-discarded-qualifiers -Wno-stringop-overread -Wno-stringop-truncation -Wno-missing-field-initializers -Wno-unused-variable -Wno-format -Wno-error=unused-result -Wno-missing-profile -Wno-stringop-overflow -Wno-free-nonheap-object -Wno-discarded-qualifiers -Wno-bad-function-cast -Wno-dangling-pointer -Wno-array-parameter -fcode-hoisting -Wno-cast-function-type -Wno-format-extra-args -Wp,-D_FORTIFY_SOURCE=2' --prefix=/usr/local/nginx --sbin-path=/usr/local/sbin/nginx --conf-path=/usr/local/nginx/conf/nginx.conf --build=180225-204816-almalinux8-kvm-9d823c6-br-a71f931 --with-compat --without-pcre2 --with-http_stub_status_module --with-http_secure_link_module --with-libatomic --with-http_gzip_static_module --add-dynamic-module=../ngx_brotli --with-http_sub_module --with-http_addition_module --with-http_image_filter_module=dynamic --with-http_geoip_module --with-stream_geoip_module --with-stream_realip_module --with-stream_ssl_preread_module --with-threads --with-stream --with-stream_ssl_module --with-http_realip_module --add-dynamic-module=../ngx-fancyindex-0.5.2 --add-module=../ngx_cache_purge-2.5.3 --add-dynamic-module=../ngx_devel_kit-0.3.2 --add-dynamic-module=../set-misc-nginx-module-0.33 --add-dynamic-module=../echo-nginx-module-0.63 --add-module=../redis2-nginx-module-0.15 --add-module=../ngx_http_redis-0.4.0-cmm --add-module=../memc-nginx-module-0.20 --add-module=../srcache-nginx-module-0.33 --add-dynamic-module=../headers-more-nginx-module-0.37 --with-pcre-jit --with-zlib=../zlib-cloudflare-1.3.3 --with-zlib-opt=-fPIC --with-http_ssl_module --with-http_v2_module
      
    • PHP Version Installed: 8.3.17
      Code (Text):
      PHP 8.3.17 (cli) (built: Mar 11 2025 19:54:46) (NTS)
      Copyright (c) The PHP Group
      Zend Engine v4.3.17, Copyright (c) Zend Technologies
          with Zend OPcache v8.3.17, Copyright (c), by Zend Technologies
      
    • MariaDB MySQL Version Installed: 10.6.21
      Code (Text):
      mysqladmin  Ver 10.0 Distrib 10.6.21-MariaDB, for Linux on x86_64
      Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
      
      Server version          10.6.21-MariaDB
      Protocol version        10
      Connection              Localhost via UNIX socket
      UNIX socket             /var/lib/mysql/mysql.sock
      Uptime:                 7 hours 46 sec
      
    • When was last time updated Centmin Mod code base ? : It's a brand new install a few hours ago.
    • 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):
      SELFSIGNEDSSL_ECDSA='y'
      PHP_OVERWRITECONF='n'
      PYTHON_INSTALL_ALTERNATIVES='y'
      MARCH_TARGETNATIVE='n'
      LETSENCRYPT_DETECT='y'
      OPENSSL_SYSTEM_USE='y'
      NGINX_SSLCACHE_ALLOWOVERRIDE='y'
      NGINX_STAPLE_CACHE_OVERRIDE='y'
      NGINX_STAPLE_CACHE_TTL='86400'
      SET_DEFAULT_MYSQLCHARSET='utf8mb4'
      AUTOHARDTUNE_NGINXBACKLOG='y'
      ZSTD_LOGROTATE_NGINX='y'
      ZSTD_LOGROTATE_PHPFPM='y'
      NGINX_LIBBROTLI='y'
      NGXDYNAMIC_BROTLI='y'
      NEEDRESTART_CHECK='y'
      PHP_BROTLI='y'
      PHP_LZFOUR='y'
      PHP_LZF='y'
      PHP_ZSTD='y'
      DMOTD_PHPCHECK='y'
      PHPFINFO='y'
      WPCLI_CE_QUERYSTRING_INCLUDED='y'
      ENABLEMOTD_CSFMSG='n'         # motd banner csf message alert disaply
      PUREFTPD_DISABLED='y'
      WP_FASTCGI_CACHE='y'
      MARIADB_INSTALLTENTHREE='n'
      MARIADB_INSTALLTENFOUR='n'
      MARIADB_INSTALLTENFIVE='n'
      MARIADB_INSTALLTENSIX='y'
      
     
  2. Itworx4me

    Itworx4me Active Member

    316
    29
    28
    Mar 14, 2017
    Ratings:
    +52
    Local Time:
    8:54 PM
    Nginx 1.27.4
    MariaDB 10.6.21
  3. eva2000

    eva2000 Administrator Staff Member

    54,945
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,812
    Local Time:
    1:54 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Which Centmin Mod version did you install ?

    what does the contents of the file at /usr/bin/nprestart contain?
    Code (Text):
    cat /usr/bin/nprestart

    should be something like
    Code (Text):
    systemctl daemon-reload; service nginx restart; systemctl restart php-fpm; echo "Restarting php-fpm (via systemctl) [  OK  ]"


    Might need to check initial install log https://community.centminmod.com/threads/how-to-troubleshoot-centmin-mod-initial-install-issues.102/ for clues as might have other issues if this part wasn't setup properly via tools/php-systemd.sh - see code on Github https://github.com/centminmod/centminmod/blob/140.00beta01/tools/php-systemd.sh

    You might be able to manually run, the script to see if it populates the right files, but run it only after providing contents of your existing /usr/bin/nprestart file
    Code (Text):
    /usr/local/src/centminmod/tools/php-systemd.sh fpm-systemd