systemd nginx service unable to start nginx 1.11.10

Maxim Dounin mdounin at mdounin.ru
Tue May 28 23:45:32 UTC 2019


Hello!

On Tue, May 28, 2019 at 03:40:57PM -0700, Vincent Li wrote:

> I am running ubuntu 16.04, the nginx package from ubuntu can be
> started from systemd ok as below shown.

[...]

> PIDFile=/run/nginx.pid

[...]

> but if I download the nginx 1.11.10 source tar ball from nginx
> download site and compile and run the nginx 1.11.10 binary, systemd
> unable to start it, systemctl hanging there and eventually failed

By default, nginx uses /usr/local/nginx/logs/nginx.pid as a PID 
file path, see "--pid-path=" here:

http://nginx.org/en/docs/configure.html

Unless you've redefined it during compilation, or set in nginx 
configuration, or changed systemd service file appropriately, 
the result:

> May 28 15:36:47 controller-dell710 systemd[1]: nginx.service: PID file
> /run/nginx.pid not readable (yet?) after start: No such file or
> directory

is expected, as your nginx configuration does not match your 
systemd service file.

-- 
Maxim Dounin
http://mdounin.ru/


More information about the nginx mailing list