1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/kiwiirc_ynh.git synced 2024-09-03 19:35:59 +02:00

Use logrotate, fix path to logfile

This commit is contained in:
Salamandar 2024-02-05 15:39:09 +01:00
parent ce77689c86
commit a64892a543
5 changed files with 19 additions and 6 deletions

View file

@ -30,11 +30,14 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
# Backup the systemd service unit # Backup the systemd service unit
ynh_backup --src_path="/etc/systemd/system/$app.service" ynh_backup --src_path="/etc/systemd/system/$app.service"
# Backup the logrotate configuration
ynh_backup --src_path="/etc/logrotate.d/$app"
#================================================= #=================================================
# BACKUP VARIOUS FILES # BACKUP VARIOUS FILES
#================================================= #=================================================
ynh_backup --src_path="/var/log/$app.log" ynh_backup --src_path="/var/log/$app"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT

View file

@ -39,7 +39,10 @@ ynh_script_progression --message="Adding system configurations related to $app..
ynh_add_nginx_config ynh_add_nginx_config
ynh_add_systemd_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 # START SYSTEMD SERVICE

View file

@ -22,6 +22,8 @@ fi
# Remove the dedicated systemd config # Remove the dedicated systemd config
ynh_remove_systemd_config ynh_remove_systemd_config
ynh_remove_logrotate
# Remove the dedicated nginx config # Remove the dedicated nginx config
ynh_remove_nginx_config ynh_remove_nginx_config
@ -31,7 +33,7 @@ ynh_remove_nginx_config
ynh_script_progression --message="Removing various files..." --weight=1 ynh_script_progression --message="Removing various files..." --weight=1
# Remove the log files # Remove the log files
ynh_secure_remove --file="/var/log/$app.log" ynh_secure_remove --file="/var/log/$app"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT

View file

@ -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" ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
systemctl enable "$app.service" --quiet 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 # RESTORE VARIOUS FILES
#================================================= #=================================================
ynh_script_progression --message="Restoring various file..." --weight=1 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 # GENERIC FINALIZATION

View file

@ -34,7 +34,10 @@ ynh_script_progression --message="Upgrading system configurations related to $ap
ynh_add_nginx_config ynh_add_nginx_config
ynh_add_systemd_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 # START SYSTEMD SERVICE