From 95ea253f91bb23f8c68e6446c12937e649e2322a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Fri, 19 Jan 2024 19:02:10 +0100 Subject: [PATCH] Fix permissions due to the system user being handled by the deb package too --- scripts/install | 3 +++ scripts/restore | 9 +++++---- scripts/upgrade | 3 +++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index a2db82d..fe9c6e0 100644 --- a/scripts/install +++ b/scripts/install @@ -29,6 +29,9 @@ ynh_add_config --template="passwd" --destination="/etc/mosquitto/passwd" mosquitto_passwd -U "/etc/mosquitto/passwd" ynh_store_file_checksum --file="/etc/mosquitto/passwd" +# Hard coded username because deb package creates the user +chown -R "mosquitto" "/etc/mosquitto" + #================================================= # SYSTEM CONFIGURATION #================================================= diff --git a/scripts/restore b/scripts/restore index b9f67ac..efa60c8 100755 --- a/scripts/restore +++ b/scripts/restore @@ -24,14 +24,15 @@ yunohost service add "$app" --description="Allows MQTT clients to send/receive d #================================================= ynh_script_progression --message="Restoring various files..." --weight=1 -# Restore the passwd file +ynh_restore_file --origin_path="/etc/mosquitto/conf.d/default.conf" ynh_restore_file --origin_path="/etc/mosquitto/passwd" -# Restore the config file -ynh_restore_file --origin_path="/etc/mosquitto/conf.d/default.conf" - ynh_restore_file --origin_path="/var/log/$app/" +# Hard coded username because deb package creates the user +chown -R "mosquitto" "/etc/mosquitto" +chown -R "mosquitto" "/var/log/$app/" + #================================================= # START SYSTEMD SERVICE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 2a799eb..516bae8 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -44,6 +44,9 @@ ynh_add_config --template="passwd" --destination="/etc/mosquitto/passwd" mosquitto_passwd -U "/etc/mosquitto/passwd" ynh_store_file_checksum --file="/etc/mosquitto/passwd" +# Hard coded username because deb package creates the user +chown -R "mosquitto" "/etc/mosquitto" + #================================================= # REAPPLY SYSTEM CONFIGURATIONS #=================================================