From b65374e8ac6c8ced7f0af30e0bb3179321ad78b7 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Mon, 8 Oct 2018 17:17:42 +0200 Subject: [PATCH] TT#45479 Ensure /run/fastcgi is owned by www-data + install file in usr/lib/tmpfiles.d/ On Debian/buster /run/fastcgi is owned by the user/group of the service which uses the directory first. ngcpcfg-api, running under root, is faster at startup than ngcp-panel, so the directory /run/fastcgi (AKA /var/run/fastcgi) is owned by root:root. ngcp-panel is running under www-data:www-data though, so missing permissions to create ngcp-panel.pid file and ngcp-panel.sock socket file inside /run/fastcgi. To ensure that /run/fastcgi is owned by www-data no matter which service starts up first rely on systemd's tmpfiles.d approach. While working on this, noticed that the file is installed inside directory /usr/lib/tmpfiles.d/ngcp-panel.conf/, while it's supposed to be named /usr/lib/tmpfiles.d/ngcp-panel.conf. Accordingly renamed the file. Thanks: Manuel Montecelo for the suggestion to use systemd's tmpfiles.d approach Change-Id: I0677fec76620839f3e670d8da9d01a8b65ff3e73 --- debian/ngcp-panel.conf | 3 +++ debian/ngcp-panel.install | 2 +- debian/ngcp-panel.tmpfiles.d.conf | 1 - 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 debian/ngcp-panel.conf delete mode 100644 debian/ngcp-panel.tmpfiles.d.conf diff --git a/debian/ngcp-panel.conf b/debian/ngcp-panel.conf new file mode 100644 index 0000000000..2ac5250eb7 --- /dev/null +++ b/debian/ngcp-panel.conf @@ -0,0 +1,3 @@ +# shipped as /usr/lib/tmpfiles.d/ngcp-panel.conf +d /tmp/ngcp 0755 www-data www-data +d /run/fastcgi 0755 www-data www-data diff --git a/debian/ngcp-panel.install b/debian/ngcp-panel.install index 1cb44b9105..51b34c36ea 100644 --- a/debian/ngcp-panel.install +++ b/debian/ngcp-panel.install @@ -1,4 +1,4 @@ -debian/ngcp-panel.tmpfiles.d.conf usr/lib/tmpfiles.d/ngcp-panel.conf +debian/ngcp-panel.conf usr/lib/tmpfiles.d/ lib/NGCP/Panel/I18N/* usr/share/perl5/NGCP/Panel/I18N logging.conf etc/ngcp-panel/ ngcp_panel.conf etc/ngcp-panel/ diff --git a/debian/ngcp-panel.tmpfiles.d.conf b/debian/ngcp-panel.tmpfiles.d.conf deleted file mode 100644 index 70d3e37c96..0000000000 --- a/debian/ngcp-panel.tmpfiles.d.conf +++ /dev/null @@ -1 +0,0 @@ -d /tmp/ngcp 0755 www-data www-data