1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/homeassistant_ynh.git synced 2024-09-03 19:26:16 +02:00

Merge pull request #24 from YunoHost-Apps/logrotate

Add logrotate
This commit is contained in:
ewilly 2021-02-21 20:43:12 +01:00 committed by GitHub
commit 5dab204f58
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 1 deletions

View file

@ -28,5 +28,6 @@ ynh_backup --src_path="$home_path"
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_backup --src_path="/etc/sudoers.d/$app"
ynh_backup --src_path="/etc/systemd/system/$app@$app.service"
ynh_backup --src_path="/etc/logrotate.d/$app"
ynh_print_info --message="Backup of $app completed"

View file

@ -77,6 +77,9 @@ ynh_store_file_checksum --file="/etc/systemd/system/$app@$app.service"
systemctl daemon-reload
ynh_systemd_action --service_name="$app@$app" --action=restart
# enable logrotate
ynh_use_logrotate --logfile="$data_path/home-assistant.log"
# create a dedicated nginx config
ynh_script_progression --message="Configuring nginx web server..."
ynh_add_nginx_config

View file

@ -36,6 +36,9 @@ ynh_systemd_action --service_name="$app@$app" --action=stop
ynh_systemd_action --service_name="$app@$app" --action=disable
ynh_secure_remove --file="/etc/systemd/system/$app@$app.service"
# remove logrotate config
ynh_remove_logrotate
# close port
ynh_exec_fully_quiet yunohost firewall disallow TCP $port

View file

@ -70,6 +70,9 @@ ynh_systemd_action --service_name="$app@$app" --action=restart --line_match="Sta
ynh_script_progression --message="Restoring nginx web server..."
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
# restore logrotate
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
# reload nginx
ynh_systemd_action --service_name=nginx --action=reload

View file

@ -73,6 +73,9 @@ ynh_store_file_checksum --file="/etc/systemd/system/$app@$app.service"
systemctl daemon-reload
ynh_systemd_action --service_name="$app@$app" --action=restart
# enable logrotate
ynh_use_logrotate --logfile="$data_path/home-assistant.log" --nonappend
# create a dedicated nginx config
ynh_script_progression --message="Configuring nginx web server..."
ynh_add_nginx_config