Welcome to Centmin Mod Community
Become a Member

Beta Branch add systemd service auto restart for nginx, php-fpm & redis

Discussion in 'Centmin Mod Github Commits' started by eva2000, May 8, 2022.

  1. eva2000

    eva2000 Administrator Staff Member

    48,440
    11,102
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,281
    Local Time:
    7:54 PM
    Nginx 1.21.x
    MariaDB 10.x
    add systemd service auto restart for nginx, php-fpm & redis


    - for nginx, php-fpm and redis systemd services add support to auto restart their respective services if service fails, crashes or exists. Auto restart will trigger 5 seconds after service failure is detected. The following config files control the settings and if they are custom edited, ensure you do run command = systemctl daemon-reload afterwards

    /etc/systemd/system/nginx.service.d/failure-restart.conf
    /etc/systemd/system/php-fpm.service.d/failure-restart.conf
    /etc/systemd/system/redis.service.d/failure-restart.conf

    Continue reading...

    130.00beta01 branch
     
  2. pamamolf

    pamamolf Premium Member Premium Member

    3,983
    412
    83
    May 31, 2014
    Ratings:
    +799
    Local Time:
    12:54 PM
    Nginx-1.17.x
    MariaDB 10.3.x
    After moving to the latest beta is a cmupdate enough to get that?

    I remember that i already did something related to use systemd according to some info from the forums here...

    Is there any check on it to avoid messing it? :)
     
  3. eva2000

    eva2000 Administrator Staff Member

    48,440
    11,102
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,281
    Local Time:
    7:54 PM
    Nginx 1.21.x
    MariaDB 10.x
    Yes on latest 124.00stable or130.00beta01 both will get the latest updates/commits via cmupdate command just like 123.09beta01 did. But whether the auto apply on an existing install depends on the update. This update doesn't auto apply as nginx uses /etc/init.d/nginx still on existing CentOS 7 systems and only uses systemd service for new 130.00beta01 installs on EL8+ systems only right now like Alma Linux 8 or Rocky Linux 8 and not on CentOS 7. There's experimental persistent configuration variable SWITCH_NGINX_SYSTEMD='y' to switch CentOS 7 based nginx /etc/init.d/nginx to use systemd service and use this above update.

    But hasn't been fully tested as much yet. Once it's tested more, I can recommend it.

    If you want to try it on 130.00beta01 you will need to backup /etc/init.d/nginx file as it gets removed and then set in persistent config file the variable SWITCH_NGINX_SYSTEMD='y' and then run centmin.sh once to switch nginx to systemd service file with above auto restart updates for nginx
     
    Last edited: May 9, 2022
  4. Pasta

    Pasta New Member

    14
    2
    3
    Aug 3, 2021
    Ratings:
    +6
    Local Time:
    5:54 PM
    Nginx 1.21.x
    MariaDB 10.4
    Did you try it?
     
  5. pamamolf

    pamamolf Premium Member Premium Member

    3,983
    412
    83
    May 31, 2014
    Ratings:
    +799
    Local Time:
    12:54 PM
    Nginx-1.17.x
    MariaDB 10.3.x
    Not yet :)