Applicable to:
- Plesk for Linux
Symptoms
-
The nginx service fails to start with the following error message:
# service nginx status
<...>
Feb 14 14:32:14 multiserver-test1 systemd[1]: PID file /run/nginx.pid not readable (yet?) after start.
Feb 14 14:33:44 multiserver-test1 systemd[1]: nginx.service start operation timed out. Terminating.
Feb 14 14:33:44 multiserver-test1 systemd[1]: Failed to start Startup script for nginx service.
Feb 14 14:33:44 multiserver-test1 systemd[1]: Unit nginx.service entered failed state.
Feb 14 14:33:44 multiserver-test1 systemd[1]: nginx.service failed. -
The directory
/run
exists on the server:# ls -ld /run
drwxr-xr-x 31 root root 920 Feb 19 10:01 /run -
The pid setting is commented out by a # (hash) character at the beginning of the line in nginx configuration files:
# grep -ir pid /etc/nginx
/etc/nginx/nginx.conf.default: #pid /var/run/nginx.pid;
/etc/nginx/nginx.conf: #pid /var/run/nginx.pid;
Cause
The directory /var/run
is not a symbolic link to the directory /run
:
# ls -ld /var/run
drwxr-xr-x 12 root root 4096 Feb 14 14:28 /var/run
Resolution
-
Connect to the Plesk server via SSH.
-
Rename the original directory:
# mv /var/run /var/run_orig
-
Create a symbolic link to
/run
:# ln -s ../run /var/run
# ls -ld /var/run
lrwxrwxrwx 1 root root 6 Feb 14 14:47 /var/run -> ../run -
Reboot the server for the changes to take affect.
-
Verify that nginx is running:
# service nginx status
Comments
2 comments
I moved my server from one VPS to another with sanpshot. Now I read same massage in the logs. Nginx eventually starts and I have no issues with it. But it happens after each restart.
Jun 29 05:15:17 XXX systemd: PID file /run/munin/munin-node.pid not readable (yet?) after start.
Jun 29 05:15:17 XXX nginx: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
Jun 29 05:15:17 XXX systemd: Started Munin Node.
Jun 29 05:15:17 XXX nginx: nginx: configuration file /etc/nginx/nginx.conf test is successful
Jun 29 05:15:17 XXX systemd: Failed to read PID from file /run/nginx.pid: Invalid argument
PID is readable and /var/run is set correctly as a soft link.
root@XXX[/]:# ls -ld /var/run
lrwxrwxrwx. 1 root root 6 Aug 8 2017 /var/run -> ../run
Any thoghts?
Thank you!
Hello @Dimitri
The issue you faced is a known Ubuntu bug. Refer to this page for workaround https://bugs.launchpad.net/ubuntu/+source/nginx/+bug/1581864
Please sign in to leave a comment.