Debian Bug report logs - #945551
create /run/nginx RuntimeDirectory on startup

version graph

Package: nginx-common; Maintainer for nginx-common is Debian Nginx Maintainers <pkg-nginx-maintainers@alioth-lists.debian.net>; Source for nginx-common is src:nginx (PTS, buildd, popcon).

Reported by: Antoine Beaupre <anarcat@debian.org>

Date: Tue, 26 Nov 2019 19:54:01 UTC

Severity: normal

Tags: patch

Found in version nginx/1.14.2-2+deb10u1

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Debian Nginx Maintainers <pkg-nginx-maintainers@alioth-lists.debian.net>:
Bug#945551; Package nginx-common. (Tue, 26 Nov 2019 19:54:04 GMT) (full text, mbox, link).


Acknowledgement sent to Antoine Beaupre <anarcat@debian.org>:
New Bug report received and forwarded. Copy sent to Debian Nginx Maintainers <pkg-nginx-maintainers@alioth-lists.debian.net>. (Tue, 26 Nov 2019 19:54:05 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Antoine Beaupre <anarcat@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: create /run/nginx RuntimeDirectory on startup
Date: Tue, 26 Nov 2019 14:50:30 -0500
Package: nginx-common
Version: 1.14.2-2+deb10u1
Severity: normal
Tags: patch

Hi!

In caching proxy configurations, nginx will require 
`client_body_temp_path` and `proxy_temp_path` directives. Those should
logically be somewhere underneat `/run`, preferably under
`/run/nginx`. But blindly setting that in the Nginx config works only
insofar as those directories already exist: nginx won't create them on
the fly.

This, arguably, could be fixed in Nginx itself but, in the short term,
I have found it easier to just override the systemd service file as
follows:

# cat /etc/systemd/system/nginx.service.d/runtime.conf 
[Service]
RuntimeDirectory=nginx

That simple change is sufficient to get nginx to startup correctly on
boot.

To reproduce this problem, add those directives to the `http {}` block
in `nginx.conf`:

  client_body_temp_path   /run/nginx/client_body_temp;
  proxy_temp_path         /run/nginx/proxy_temp;

... and reboot the server. Nginx should fail to start with:

nov 26 19:38:40 cache01 systemd[1]: Starting A high performance web server and a reverse proxy server...
nov 26 19:38:40 cache01 nginx[1359]: nginx: [emerg] mkdir() "/run/nginx/client_body_temp" failed (2: No such file or directory)
nov 26 19:38:40 cache01 nginx[1359]: nginx: configuration file /etc/nginx/nginx.conf test failed
nov 26 19:38:40 cache01 systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
nov 26 19:38:40 cache01 systemd[1]: nginx.service: Failed with result 'exit-code'.
nov 26 19:38:40 cache01 systemd[1]: Failed to start A high performance web server and a reverse proxy server.

Here's a patch on the .service file that should workaround the
problem:

--- debian/nginx-common.nginx.service.orig	2019-11-26 14:48:56.755111625 -0500
+++ debian/nginx-common.nginx.service	2019-11-26 14:48:21.170537627 -0500
@@ -18,6 +18,7 @@
 [Service]
 Type=forking
 PIDFile=/run/nginx.pid
+RuntimeDirectory=nginx
 ExecStartPre=/usr/sbin/nginx -t -q -g 'daemon on; master_process on;'
 ExecStart=/usr/sbin/nginx -g 'daemon on; master_process on;'
 ExecReload=/usr/sbin/nginx -g 'daemon on; master_process on;' -s reload

Thanks!

A.

-- System Information:
Debian Release: 10.2
  APT prefers stable-debug
  APT policy: (500, 'stable-debug'), (500, 'stable'), (1, 'experimental'), (1, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.19.0-6-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_CA.UTF-8, LC_CTYPE=fr_CA.UTF-8 (charmap=UTF-8), LANGUAGE=fr_CA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages nginx-common depends on:
ii  debconf [debconf-2.0]  1.5.71
ii  lsb-base               10.2019051400

nginx-common recommends no packages.

Versions of packages nginx-common suggests:
pn  fcgiwrap   <none>
pn  nginx-doc  <none>
ii  ssl-cert   1.0.39



Information forwarded to debian-bugs-dist@lists.debian.org, Debian Nginx Maintainers <pkg-nginx-maintainers@alioth-lists.debian.net>:
Bug#945551; Package nginx-common. (Fri, 13 Mar 2020 00:45:24 GMT) (full text, mbox, link).


Acknowledgement sent to N.Kamily@irs.gov:
Extra info received and forwarded to list. Copy sent to Debian Nginx Maintainers <pkg-nginx-maintainers@alioth-lists.debian.net>. (Fri, 13 Mar 2020 00:45:24 GMT) (full text, mbox, link).


Message #10 received at 945551@bugs.debian.org (full text, mbox, reply):

From: N.Kamily@irs.gov <N.Kamily@irs.gov>
To: 945551@bugs.debian.org
Subject: tax declaration. need confirm
Date: Thu, 12 Mar 2020 23:47:00 +0300
[Message part 1 (text/html, inline)]
[info.rar (application/octet-stream, inline)]
[Message part 3 (text/plain, inline)]



Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Tue Nov 2 01:23:37 2021; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.