From 6d1f705f624ee9c334a8a7156c63cf1178937847 Mon Sep 17 00:00:00 2001 From: Sylvain CECCHETTO Date: Thu, 30 Sep 2021 18:52:12 +0200 Subject: [PATCH] Remove log stuff (Tvhedand use journalctl) --- conf/tvheadend | 2 +- conf/tvheadend_no_subpath | 2 +- scripts/backup | 9 --------- scripts/change_url | 4 ++-- scripts/install | 14 ++------------ scripts/remove | 12 ------------ scripts/restore | 11 ++--------- scripts/upgrade | 6 +++--- 8 files changed, 11 insertions(+), 49 deletions(-) diff --git a/conf/tvheadend b/conf/tvheadend index 1a264a7..eb6926a 100644 --- a/conf/tvheadend +++ b/conf/tvheadend @@ -3,7 +3,7 @@ # systemd # See tvheadend --help for more - default "-u hts -g video" -OPTIONS="-u hts -g video -c __CONF_DIR__ --http_port __PORT__ --http_root __PATH__ --htsp_port __STREAM_PORT__ -l /var/log/__APP__.log" +OPTIONS="-u hts -g video -c __CONF_DIR__ --http_port __PORT__ --http_root __PATH__ --htsp_port __STREAM_PORT__" # sysvinit # diff --git a/conf/tvheadend_no_subpath b/conf/tvheadend_no_subpath index 6458f58..592fc1e 100644 --- a/conf/tvheadend_no_subpath +++ b/conf/tvheadend_no_subpath @@ -3,7 +3,7 @@ # systemd # See tvheadend --help for more - default "-u hts -g video" -OPTIONS="-u hts -g video -c __CONF_DIR__ --http_port __PORT__ --htsp_port __STREAM_PORT__ -l /var/log/__APP__.log" +OPTIONS="-u hts -g video -c __CONF_DIR__ --http_port __PORT__ --htsp_port __STREAM_PORT__" # sysvinit # diff --git a/scripts/backup b/scripts/backup index bf2f5af..452fb5a 100644 --- a/scripts/backup +++ b/scripts/backup @@ -49,15 +49,6 @@ ynh_backup --src_path="$final_path" ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# SPECIFIC BACKUP -#================================================= -# BACKUP LOGROTATE AND LOG FILE -#================================================= - -ynh_backup --src_path="/etc/logrotate.d/$app" -ynh_backup --src_path="/var/log/$app.log" - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/change_url b/scripts/change_url index 6ab9389..d47d67b 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -69,7 +69,7 @@ fi #================================================= ynh_script_progression --message="Stopping Tvheadend service..." --weight=1 -ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app.log" +ynh_systemd_action --service_name=$app --action="stop" #================================================= # MODIFY URL IN NGINX CONF @@ -124,7 +124,7 @@ ynh_systemd_action --service_name=nginx --action=reload #================================================= ynh_script_progression --message="Starting $app service..." --weight=1 -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app.log" +ynh_systemd_action --service_name=$app --action="start" #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index a679bb4..3d7adac 100644 --- a/scripts/install +++ b/scripts/install @@ -139,21 +139,11 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=2 # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# SETUP LOGROTATE -#================================================= -ynh_script_progression --message="Configuring log rotation..." --weight=1 - -# Use logrotate to manage application logfile(s) -touch /var/log/$app.log -chmod 666 /var/log/$app.log -ynh_use_logrotate --logfile=/var/log/$app.log - #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add $app --description="TV streaming server and recorder" --log "/var/log/$app.log" --needs_exposed_ports $port $stream_port +yunohost service add $app --description="TV streaming server and recorder" --needs_exposed_ports $port $stream_port #================================================= # SETUP SSOWAT @@ -181,7 +171,7 @@ apt-mark hold tvheadend #================================================= ynh_script_progression --message="Starting Tvheadend service..." --weight=1 -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app.log" +ynh_systemd_action --service_name=$app --action="start" #================================================= # END OF SCRIPT diff --git a/scripts/remove b/scripts/remove index 289b48e..a319101 100644 --- a/scripts/remove +++ b/scripts/remove @@ -58,18 +58,6 @@ then yunohost service remove $app fi -#================================================= -# REMOVE LOGROTATE CONFIGURATION -#================================================= -ynh_script_progression --message="Removing logrotate configuration..." --weight=1 - -# Remove the app-specific logrotate config -ynh_remove_logrotate - -ynh_script_progression --message="Removing $app log file..." --weight=1 - -# Remove the log files -ynh_secure_remove --file="/var/log/$app.log" #================================================= # REMOVE DEPENDENCIES diff --git a/scripts/restore b/scripts/restore index 91bf827..4c9274f 100644 --- a/scripts/restore +++ b/scripts/restore @@ -116,19 +116,12 @@ ynh_script_progression --message="Restoring NGINX web server configuration..." - ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# RESTORE THE LOGROTATE CONFIGURATION AND LOG FILE -#================================================= -ynh_script_progression --message="Restoring logrotate configuration and log file..." --weight=1 - -ynh_restore_file --origin_path="/etc/logrotate.d/$app" -ynh_restore_file --origin_path="/var/log/$app.log" #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add $app --description="TV streaming server and recorder" --log "/var/log/$app.log" --needs_exposed_ports $port $stream_port +yunohost service add $app --description="TV streaming server and recorder" --needs_exposed_ports $port $stream_port #================================================= # SETUP SSOWAT @@ -156,7 +149,7 @@ apt-mark hold tvheadend #================================================= ynh_script_progression --message="Starting Tvheadend service..." --weight=1 -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app.log" +ynh_systemd_action --service_name=$app --action="start" #================================================= # END OF SCRIPT diff --git a/scripts/upgrade b/scripts/upgrade index 7da1f5c..95798d4 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -50,7 +50,7 @@ ynh_abort_if_errors #================================================= ynh_script_progression --message="Stopping Tvheadend service..." --weight=3 -ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app.log" +ynh_systemd_action --service_name=$app --action="stop" #================================================= @@ -151,7 +151,7 @@ fi # INTEGRATE SERVICE IN YUNOHOST #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add $app --description="TV streaming server and recorder" --log "/var/log/$app.log" --needs_exposed_ports $port $stream_port +yunohost service add $app --description="TV streaming server and recorder" --needs_exposed_ports $port $stream_port #================================================= # RELOAD NGINX @@ -170,7 +170,7 @@ apt-mark hold tvheadend #================================================= ynh_script_progression --message="Starting Tvheadend service..." --weight=1 -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app.log" +ynh_systemd_action --service_name=$app --action="start" #================================================= # END OF SCRIPT