Hi,
Using nginx-1.9.7 (though I think it's always been there), I've noticed that when running "nginx -t" as root after a fresh install, results in the /run/nginx.pid file being created.
This creates a problem on the subsequent "systemctl start nginx":
Nov 20 20:50:39 localhost.localdomain nginx[557]: nginx: [emerg] open() "/run/nginx.pid" failed (13: Permission denied)
However, at the end of the above step, the PID file is removed, and so repeating "systemctl start nginx" now succeeds...
I suspect that the 1st attempt at starting fails because the nginx.pid file contains no PID (0 byte file), which is probably misinterpreted by higher software layers as a permissions problem (I have not checked the source code...)
That said, I don't see the need to create a PID file when nginx is run with -t, since the intention is just to scan the configuration, not run the daemon.
Thanks for your time.
--
SuperTCP for NGINX
www.supertcp.com
Edited 1 time(s). Last edit at 11/21/2015 10:36AM by superTCP.