美文网首页
Failed to parse PID from file ..

Failed to parse PID from file ..

作者: AydanLinux | 来源:发表于2023-06-15 23:33 被阅读0次

Failed to parse PID from file ...

Error message

nginx.service: Failed to parse PID from file /usr/local/nginx/run/nginx.pid: Invalid argument

Step 1. Create a directory

Create a directory named nginx.service.d in /etc/systemd/system/:

mkdir /etc/systemd/system/nginx.service.d
cd /etc/systemd/system/nginx.service.d

Step 2. Print data to file

printf "[Service]\nExecStartPost=/bin/sleep 0.1\n" > override.conf

Step 3. Reload the daemon

Reload systemd manager configuration:

systemctl daemon-reload

This will rerun all generators, reload all unit files and recreate the entire systemd dependency tree.

Step 4. Restart NGINX

This line will restart NGINX for you:

systemctl restart nginx

The error should be fixed now.

An alternative workaround

Another workaround is removing the PIDFile option and adding the line:

ExecStopPost=/bin/rm -f /run/nginx.pid

相关文章

网友评论

      本文标题:Failed to parse PID from file ..

      本文链接:https://www.haomeiwen.com/subject/fytrydtx.html