Join the community today
Register Now

[Solved] Install Change Service command for Almalinux9

Discussion in 'Bug Reports' started by brijendrasial, May 18, 2025.

  1. brijendrasial

    brijendrasial Active Member

    209
    154
    43
    Mar 21, 2018
    Ratings:
    +236
    Local Time:
    4:16 PM
    1.13.9
    10.0.22-MariaDB
    nprestart
    /bin/nprestart: line 1: service: command not found
    Restarting php-fpm (via systemctl) [ OK ]

    Please change service nginx restart to systemctl restart nginx as almalinux 9 doesn't support service.


    :)
     
  2. eva2000

    eva2000 Administrator Staff Member

    55,917
    12,281
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,868
    Local Time:
    8:46 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    it should dynamic have been changed at initial installation of Centmin Mod. When EL8/EL9 OSes detected it should use systemctl and only EL7 CentOS 7 shows service. Though @pamamolf reported similar issue as did @Mike Guista https://community.centminmod.com/threads/nginx-restart-short-command-doesnt-work.27681/

    Which Centmin Mod version did you install ? New install or very old install that upgraded through various Centmin Mod versions? i.e. 123.09beta01 update to 130.00beta01 to 140.00beta01? or fresh 140.00beta01 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
    
     
  3. eva2000

    eva2000 Administrator Staff Member

    55,917
    12,281
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,868
    Local Time:
    8:46 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    actually think i found a bug in /usr/local/src/centminmod/tools/php-systemd.sh :)

    Fixed it in 131.00stable, 132.00stable and 140.00beta01. On centmin.sh menu option 5 runs it should auto run /usr/local/src/centminmod/tools/php-systemd.sh with fix. If not you can try manually running these 2 commands

    Code (Text):
    cmupdate
    /usr/local/src/centminmod/tools/php-systemd.sh fpm-systemd