Project

General

Profile

Bug #6380

nginx.pre-install should create the /run/nginx directory if it does not already exist

Added by Joe Borg about 2 years ago. Updated about 2 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
Category:
Package update
Target version:
Start date:
10/25/2016
Due date:
% Done:

0%

Estimated time:
1.00 h
Affected versions:
Security IDs:

Description

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)

History

#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.

http://bugs.alpinelinux.org/issues/6380
---
main/nginx/nginx.pre-install | 4 +++
1 file changed, 4 insertions(
)

diff --git a/main/nginx/nginx.pre-install b/main/nginx/nginx.pre-install
index ae5b685..e30aa2f 100644
--- a/main/nginx/nginx.pre-install
+++ b/main/nginx/nginx.pre-install
@ -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

if [ ! -d /run/nginx ]; then
mkdir /run/nginx
fi

exit 0

#2 Updated by Natanael Copa about 2 years ago

we need to create the dir at runtime since /run is normally a tmpfs dir.

This means that whatever starts nginx needs to make sure the dir is there.

#3 Updated by Natanael Copa about 2 years ago

  • Target version changed from 3.4.5 to 3.4.6

#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.

Also available in: Atom PDF