Problems migrating vultr to Linode
systemctl status nginx
ngx systemd[1]: nginx.service: Failed to read PID from file /run/nginx.pid: Invalid argument
Above vultr is normal
2 Replies
This is a known bug caused by a race condition between NGINX and systemd on single-CPU systems. Specifically, systemd is attempting to read the NGINX PID before it has been created. I can confirm that the solution posted in the bug report resolves — it will delay systemd briefly and allow the PID to exist before it is accessed. Here are the commands for your convenience (run these with sudo
as necessary):
mkdir /etc/systemd/system/nginx.service.d
printf "[Service]\nExecStartPost=/bin/sleep 0.1\n" > \
/etc/systemd/system/nginx.service.d/override.conf
systemctl daemon-reload
systemctl restart nginx
systemctl status nginx
Alternatively, you could resize your Linode to have more than 2 CPUs.
google search solve
https://bugs.launchpad.net/ubuntu/+source/nginx/+bug/1581864
sudo mkdir /etc/systemd/system/nginx.service.d
printf "[Service]\nExecStartPost=/bin/sleep 0.1\n" | \
sudo tee /etc/systemd/system/nginx.service.d/override.conf
sudo systemctl daemon-reload
sudo systemctl restart nginx