1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/tvheadend_ynh.git synced 2024-10-01 13:34:50 +02:00

Remove log stuff (Tvhedand use journalctl)

This commit is contained in:
Sylvain CECCHETTO 2021-09-30 18:52:12 +02:00
parent 24febd0745
commit 6d1f705f62
8 changed files with 11 additions and 49 deletions

View file

@ -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
#

View file

@ -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
#

View file

@ -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
#=================================================

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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