From 6cccdf38254d2d689499baf65ac522c35d7582f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 6 Oct 2023 14:25:09 +0200 Subject: [PATCH] fix --- scripts/install | 8 +++++--- scripts/restore | 7 ++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/scripts/install b/scripts/install index 6f2115a..65cb3d0 100644 --- a/scripts/install +++ b/scripts/install @@ -39,11 +39,14 @@ ynh_add_nginx_config # Create a dedicated systemd config ynh_add_systemd_config -yunohost service add $app --description="Federated shared agenda for local communities" --log="/var/log/$app/$app.log" - # Use logrotate to manage application logfile(s) ynh_use_logrotate +mkdir -p /var/log/$app +chown $app -R /var/log/$app + +yunohost service add $app --description="Federated shared agenda for local communities" --log="/var/log/$app/$app.log" + #================================================= # APP INITIAL CONFIGURATION #================================================= @@ -55,7 +58,6 @@ ynh_add_config --template="config.json" --destination="$install_dir/config.json" chmod 400 "$install_dir/config.json" chown $app:$app "$install_dir/config.json" -chown $app:$app "/var/log/$app" #================================================= # INSTALL YARN AND APP diff --git a/scripts/restore b/scripts/restore index 4fb2375..5693046 100644 --- a/scripts/restore +++ b/scripts/restore @@ -18,6 +18,7 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$install_dir" chown -R $app:www-data "$install_dir" +chown $app:$app "/var/log/$app" #================================================= # RESTORE THE DATA DIRECTORY @@ -48,10 +49,10 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable $app.service --quiet -yunohost service add $app --description="Federated shared agenda for local communities" --log="/var/log/$app/$app.log" - ynh_restore_file --origin_path="/etc/logrotate.d/$app" +yunohost service add $app --description="Federated shared agenda for local communities" --log="/var/log/$app/$app.log" + #================================================= # GENERIC FINALIZATION #================================================= @@ -67,4 +68,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Restoration completed for $app" --last \ No newline at end of file +ynh_script_progression --message="Restoration completed for $app" --last