K
K
Kirill Kazakov2015-07-03 03:43:30
Nginx
Kirill Kazakov, 2015-07-03 03:43:30

How to remove the error nginx Failed to read PID from file /run/nginx.pid: Invalid argument?

Nginx works, but the error confuses:
#service nginx status


systemd[1]: Failed to read PID from file /run/nginx.pid: Invalid argument
systemd[1]: Started A high performance web server and a reverse proxy server.

# cat /run/nginx.pid
9953

ls -la /run/nginx.pid
-rw-r--r-- 1 root root 5 Jul 3 03:21 /run/nginx.pid

Or nginx cannot find the file before starting (after restart for example), then it creates it and then it starts normally?
The error.log is empty.
Update1:
service nginx status
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled)
Active: active (running) since Fri 2015-07-03 04: 16:07 MSK; 28s ago
Process: 14261 ExecStop=/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid (code=exited, status=0/SUCCESS)
Process: 14366 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Process: 14363 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Main PID: 14367 (nginx)
CGroup: /system.slice/nginx.service
├─14367 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
└─14379 nginx: worker process

Upd2:
After restarting the machine, the problem itself disappeared ....

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2015-07-03
@Weidmann

comment out pid /path in nginx.conf;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question