nginx systemd reload service command skips configtest

Christ-Jan Wijtmans cj.wijtmans at gmail.com
Sun Sep 27 15:06:00 UTC 2015


I support this thought.

Live long and prosper,

Christ-Jan Wijtmans
https://github.com/cjwijtmans
http://facebook.com/cj.wijtmans
http://twitter.com/cjwijtmans


On Sat, Sep 26, 2015 at 11:03 PM, Per Hansson <nginx-forum at nginx.us> wrote:
> Hi, the "nginx.service" file shipped with systemd rpm's both in nginx's
> stable repository and epel for CentOS7 / RHEL7 do not perform a "configtest"
> when "systemctl reload nginx" is issued.
> So if there is an error in the configuration file nginx is killed but not
> started due to the faulty configuration.
> It's possible to mitigate this in the nginx.service file by having two
> "ExecReload" commands on separate lines like so:
> # grep ExecReload /usr/lib/systemd/system/nginx.service
> ExecReload=/usr/sbin/nginx -t
> ExecReload=/bin/kill -s HUP $MAINPID
>
> This way if the configtest in the first line fails nginx is never killed,
> the command does not print any output but that is a systemd issue so I think
> unavoidable.
>
> I can't guarantee that this is a supported way to do this but it works for
> me at least :)
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?2,261864,261864#msg-261864
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx



More information about the nginx mailing list