1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/navidrome_ynh.git synced 2024-09-03 19:46:30 +02:00
This commit is contained in:
ericgaspar 2020-08-17 20:58:21 +02:00
parent 3260425a17
commit 1ceb9e8f9a
6 changed files with 26 additions and 7 deletions

View file

@ -54,6 +54,12 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# SPECIFIC BACKUP
#=================================================
# BACKUP LOGROTATE
#=================================================
ynh_backup --src_path="/etc/logrotate.d/$app"
#=================================================
# BACKUP SYSTEMD
#=================================================

View file

@ -109,7 +109,7 @@ fi
ynh_script_progression --message="Starting a systemd service..." --weight=1
# Start a systemd service
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Version:"
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" --line_match="Version:"
#=================================================
# RELOAD NGINX

View file

@ -153,7 +153,6 @@ chmod -R 764 /home/yunohost.$app
#=================================================
ynh_script_progression --message="Configuring log rotation..." --weight=1
# FIXME Currently, the log is only redirected to syslog.
mkdir -p /var/log/$app
touch /var/log/$app/$app.log
chown $app -R /var/log/$app

View file

@ -76,7 +76,7 @@ ynh_remove_nginx_config
#=================================================
# REMOVE LOGROTATE CONFIGURATION
#=================================================
ynh_script_progression --message="Removing logrotate configuration..." --weight=1
ynh_script_progression --message="Removing logs and logrotate configuration..." --weight=1
ynh_secure_remove --file="/var/log/$app"

View file

@ -103,14 +103,20 @@ systemctl enable $app.service
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..."
yunohost service add $app --description "Web-based music collection server and streamer"
yunohost service add $app --description "Web-based music collection server and streamer" --log_path="/var/log/$app/$app.log"
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Version:"
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" --line_match="Version:"
#=================================================
# RESTORE THE LOGROTATE CONFIGURATION
#=================================================
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
#=================================================
# GENERIC FINALIZATION

View file

@ -146,19 +146,27 @@ chown -R $app:$app $config_path
chown -R $app:www-data /home/yunohost.$app/
chmod -R 764 /home/yunohost.$app
#=================================================
# SETUP LOGROTATE
#=================================================
ynh_script_progression --message="Upgrading logrotate configuration..." --time --weight=1
# Use logrotate to manage app-specific logfile(s)
ynh_use_logrotate --non-append
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..."
yunohost service add $app --description "Web-based music collection server and streamer"
yunohost service add $app --description "Web-based music collection server and streamer" --log_path="/var/log/$app/$app.log"
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Version:"
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" --line_match="Version:"
#=================================================
# RELOAD NGINX