From 1ca9e5984b268d90f3ca9c1f2f81c1c0859d0662 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Sun, 28 Feb 2021 23:29:31 +0000 Subject: [PATCH] Only create /run/mosquitto at runtime. Per policy, packages shouldn't contain directories in /run. This means /run/mosquitto should be created at boot time. Closes #983429. --- debian/changelog | 2 ++ debian/mosquitto.dirs | 1 - debian/mosquitto.init | 2 ++ debian/mosquitto.postinst | 1 - 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0c06a1d5..e8b8c676 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,8 @@ mosquitto (2.0.8-2) unstable; urgency=medium * Remove debian-config.patch, this is already handled with debian/mosquitto.conf + * Per policy, packages shouldn't contain directories in /run. This means + /run/mosquitto should be created at boot time. Closes #983429. -- Roger A. Light Sun, 28 Feb 2021 23:22:57 +0000 diff --git a/debian/mosquitto.dirs b/debian/mosquitto.dirs index 60cf0861..994abd5b 100644 --- a/debian/mosquitto.dirs +++ b/debian/mosquitto.dirs @@ -1,3 +1,2 @@ var/lib/mosquitto var/log/mosquitto -/run/mosquitto diff --git a/debian/mosquitto.init b/debian/mosquitto.init index 28913bf4..9743ee92 100755 --- a/debian/mosquitto.init +++ b/debian/mosquitto.init @@ -44,6 +44,8 @@ case "$1" in exit 1 fi log_daemon_msg "Starting network daemon:" "mosquitto" + mkdir -m 740 -p /run/mosquitto + chown mosquitto: /run/mosquitto if start-stop-daemon --start --quiet --oknodo --background --make-pidfile --pidfile ${PIDFILE} --exec ${DAEMON} -- -c /etc/mosquitto/mosquitto.conf ; then log_end_msg 0 else diff --git a/debian/mosquitto.postinst b/debian/mosquitto.postinst index 1e676007..90f4dabd 100644 --- a/debian/mosquitto.postinst +++ b/debian/mosquitto.postinst @@ -17,7 +17,6 @@ setup_mosquitto_user() { fix_permissions() { chown mosquitto /var/lib/mosquitto - chown mosquitto /run/mosquitto test ! -e /var/log/mosquitto || chown mosquitto /var/log/mosquitto test ! -e /var/log/mosquitto/mosquitto.log || chown mosquitto /var/log/mosquitto/mosquitto.log }