nginx.pre-install should create the /run/nginx directory if it does not already exist
The lack of this means that you get the following error when trying to run Nginx after install:
nginx: [emerg] open() "/run/nginx/nginx.pid" failed (2: No such file or directory)
#1 Updated by Joe Borg about 2 years ago
Created and emailed patch
Nginx throws an error, the first time you run it, because the /run/nginx
directory does not exist. Have added to the pre-install script to create this,
if it doesn't already exist.
main/nginx/nginx.pre-install | 4 +)
diff --git a/main/nginx/nginx.pre-install b/main/nginx/nginx.pre-install
index ae5b685..e30aa2f 100644
@ -5,4 +5,8 @ addgroup -S nginx 2>/dev/null
adduser -S -D -H -h /var/lib/nginx -s /sbin/nologin -G nginx -g nginx nginx 2>/dev/null
addgroup nginx www-data 2>/dev/null
#4 Updated by Jakub Jirutka about 2 years ago
- Status changed from New to Rejected
This is already handled in nginx runscript – /run/nginx is created if not exists yet. I’ve verified that in edge, v3.4.0 and v3.3.0.
The just a Docker problem – it does not run init system, so the directory is not created. The solution (workaround?) is to create this directory in Dockerfile.