I'm running Linux Mint 19.2 Tina, which should be equivalent to Ubuntu 18.04.
When I issue the command sudo systemctl stop nginx.service
then systemctl start nginx.service
I frequently get the error
Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xe" for details.
and
nginx: [error] open() "/run/nginx.pid" failed (2: No such file or directory)
I'm not able to restart nginx with the systemctl command, but checking with ps aux | grep nginx
shows that nginx is running. Checking with sudo ss -lnp | grep nginx
shows that the process is bound to port 80 and port 443. But /run/nginx.pid
does not exist.
I can kill this process manually with sudo kill $PID_OF_MASTER_NGINX_PROCESS
but the normal control commands don't work.