Browse Source

Adding config test before reload

ExecStartPre has nginx -t to test the Nginx config before starting
the service initially but ExecReload will just issue an Nginx reload
without testing the config first. If the config ends up being bad
this takes Nginx down. Perform a config test before reloading and if
that fails leave Nginx running on the previous config in RAM.
master
Nate Bohman 6 years ago
parent
commit
9d85e68dc3
1 changed files with 1 additions and 0 deletions
  1. +1
    -0
      nginx/ng/files/nginx.service

+ 1
- 0
nginx/ng/files/nginx.service View File

PIDFile=/run/nginx.pid PIDFile=/run/nginx.pid
ExecStartPre=/usr/sbin/nginx -t ExecStartPre=/usr/sbin/nginx -t
ExecStart=/usr/sbin/nginx ExecStart=/usr/sbin/nginx
ExecReload=/usr/sbin/nginx -t
ExecReload=/usr/sbin/nginx -s reload ExecReload=/usr/sbin/nginx -s reload
ExecStop=/bin/kill -s QUIT $MAINPID ExecStop=/bin/kill -s QUIT $MAINPID
Restart=on-failure Restart=on-failure

Loading…
Cancel
Save