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
Â