diff --git a/scripts/backup b/scripts/backup index 273bf59..b09c1c6 100644 --- a/scripts/backup +++ b/scripts/backup @@ -30,11 +30,14 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" # Backup the systemd service unit ynh_backup --src_path="/etc/systemd/system/$app.service" +# Backup the logrotate configuration +ynh_backup --src_path="/etc/logrotate.d/$app" + #================================================= # BACKUP VARIOUS FILES #================================================= -ynh_backup --src_path="/var/log/$app.log" +ynh_backup --src_path="/var/log/$app" #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index 442bf6f..c6690c4 100644 --- a/scripts/install +++ b/scripts/install @@ -39,7 +39,10 @@ ynh_script_progression --message="Adding system configurations related to $app.. ynh_add_nginx_config ynh_add_systemd_config -yunohost service add "$app" --description="Versatile web based messenger using IRC" --log="/var/log/$app.log" +yunohost service add "$app" --description="Versatile web based messenger using IRC" --log="/var/log/$app/$app.log" + +# Use logrotate to manage application logfile(s) +ynh_use_logrotate #================================================= # START SYSTEMD SERVICE diff --git a/scripts/remove b/scripts/remove index d1a8d31..13b2032 100644 --- a/scripts/remove +++ b/scripts/remove @@ -22,6 +22,8 @@ fi # Remove the dedicated systemd config ynh_remove_systemd_config +ynh_remove_logrotate + # Remove the dedicated nginx config ynh_remove_nginx_config @@ -31,7 +33,7 @@ ynh_remove_nginx_config ynh_script_progression --message="Removing various files..." --weight=1 # Remove the log files -ynh_secure_remove --file="/var/log/$app.log" +ynh_secure_remove --file="/var/log/$app" #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index 46494ed..6867dc6 100644 --- a/scripts/restore +++ b/scripts/restore @@ -27,14 +27,16 @@ 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="Versatile web based messenger using IRC" --log="/var/log/$app.log" +yunohost service add "$app" --description="Versatile web based messenger using IRC" --log="/var/log/$app/$app.log" + +ynh_restore_file --origin_path="/etc/logrotate.d/$app" #================================================= # RESTORE VARIOUS FILES #================================================= ynh_script_progression --message="Restoring various file..." --weight=1 -ynh_restore_file --origin_path="/var/log/$app.log" +ynh_restore_file --origin_path="/var/log/$app" #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index f32f2c6..34300de 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -34,7 +34,10 @@ ynh_script_progression --message="Upgrading system configurations related to $ap ynh_add_nginx_config ynh_add_systemd_config -yunohost service add "$app" --description="Versatile web based messenger using IRC" --log="/var/log/$app.log" +yunohost service add "$app" --description="Versatile web based messenger using IRC" --log="/var/log/$app/$app.log" + +# Use logrotate to manage application logfile(s) +ynh_use_logrotate #================================================= # START SYSTEMD SERVICE