From 9ff3ee9c9fc1cf02e358bb1b627acab13f734da6 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Tue, 5 Jul 2022 09:34:27 -0400 Subject: [PATCH] TT#182450 manage /var/spool/rtpengine in rtpengine-daemon /var/spool/rtpengine is used by the main daemon as well as the recording daemon. The recording daemon is not really useful without the main daemon, while it's perfectly fine to use the main daemon without the recording daemon. That directory should therefore be managed by the main daemon package. This fixes a broken systemd unit stemming from a missing directory if the recording daemon is not installed. Fix-up for 26bf2b05a570be8af22db2585e3c4292fe1d4012 Fix-up for I4abf4df218b1ba0dc70ed8974c0661d16e0b6ea7 Fixes GH #1510 Change-Id: If75b6c1b675c8abf0bb33ae58b41e036276f8640 (cherry picked from commit de8b3d59c185de3d8bf35904fac99fcf12be4ef3) --- debian/ngcp-rtpengine-daemon.dirs | 1 + debian/ngcp-rtpengine-daemon.postinst | 7 +++++++ debian/ngcp-rtpengine-recording-daemon.dirs | 1 - debian/ngcp-rtpengine-recording-daemon.postinst | 2 +- 4 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 debian/ngcp-rtpengine-daemon.dirs diff --git a/debian/ngcp-rtpengine-daemon.dirs b/debian/ngcp-rtpengine-daemon.dirs new file mode 100644 index 000000000..353740ab6 --- /dev/null +++ b/debian/ngcp-rtpengine-daemon.dirs @@ -0,0 +1 @@ +var/spool/rtpengine diff --git a/debian/ngcp-rtpengine-daemon.postinst b/debian/ngcp-rtpengine-daemon.postinst index aebf1b426..f7be6d0b0 100644 --- a/debian/ngcp-rtpengine-daemon.postinst +++ b/debian/ngcp-rtpengine-daemon.postinst @@ -36,6 +36,13 @@ if [ "$1" = configure ]; then adduser --system --home /nonexistent --gecos rtpengine \ --no-create-home --disabled-password \ --group --quiet rtpengine || true + + for DIR in /var/spool/rtpengine; do + if ! dpkg-statoverride --list "$DIR" > /dev/null 2>&1; then + chown rtpengine:rtpengine "$DIR" + chmod 0770 "$DIR" + fi + done fi #DEBHELPER# diff --git a/debian/ngcp-rtpengine-recording-daemon.dirs b/debian/ngcp-rtpengine-recording-daemon.dirs index b7df8da6e..6d923d3dd 100644 --- a/debian/ngcp-rtpengine-recording-daemon.dirs +++ b/debian/ngcp-rtpengine-recording-daemon.dirs @@ -1,2 +1 @@ var/lib/rtpengine-recording -var/spool/rtpengine diff --git a/debian/ngcp-rtpengine-recording-daemon.postinst b/debian/ngcp-rtpengine-recording-daemon.postinst index a85dbebdb..fe6c81571 100644 --- a/debian/ngcp-rtpengine-recording-daemon.postinst +++ b/debian/ngcp-rtpengine-recording-daemon.postinst @@ -3,7 +3,7 @@ set -e if [ "$1" = configure ]; then - for DIR in /var/lib/rtpengine-recording /var/spool/rtpengine; do + for DIR in /var/lib/rtpengine-recording; do if ! dpkg-statoverride --list "$DIR" > /dev/null 2>&1; then chown rtpengine:rtpengine "$DIR" chmod 0770 "$DIR"