1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pyload_ynh.git synced 2024-09-03 20:16:04 +02:00

Fix logrotate

This commit is contained in:
yalh76 2022-03-28 18:07:45 +02:00
parent 3463e8e854
commit 4cb622116b
3 changed files with 25 additions and 13 deletions

View file

@ -56,6 +56,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

@ -91,19 +91,6 @@ ynh_script_progression --message="Reinstalling dependencies..."
# Define and install dependencies
ynh_install_app_dependencies $pkg_dependencies
#=================================================
# INSTALL PYTHON DEPENDENCIES
#=================================================
ynh_script_progression --message="Installing Python dependencies..."
pushd $final_path
python3 -m venv $final_path/venv
source $final_path/venv/bin/activate
pip install --upgrade pip
pip install --upgrade pyyaml
pip install --pre pyload-ng[all]
popd
#=================================================
# RESTORE SYSTEMD
#=================================================
@ -112,6 +99,15 @@ ynh_script_progression --message="Restoring the systemd configuration..."
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
systemctl enable $app.service --quiet
#=================================================
# RESTORE THE LOGROTATE CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the logrotate configuration..."
mkdir -p /var/log/$app
chown -R $app:$app "/var/log/$app"
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================

View file

@ -112,6 +112,16 @@ ynh_add_systemd_config
#=================================================
# GENERIC FINALIZATION
#=================================================
# SETUP LOGROTATE
#=================================================
ynh_script_progression --message="Upgrading logrotate configuration..."
mkdir -p /var/log/$app
chown -R $app:$app "/var/log/$app"
# Use logrotate to manage app-specific logfile(s)
ynh_use_logrotate --non-append
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================