From 24e499e357f32f5087222598ec7a55ad38cee3d9 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 21 Jan 2024 16:29:47 +0100 Subject: [PATCH] restore systemd --- scripts/restore | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/scripts/restore b/scripts/restore index f489d88..e60c564 100644 --- a/scripts/restore +++ b/scripts/restore @@ -29,12 +29,28 @@ ynh_psql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./d #================================================= # RESTORE SYSTEM CONFIGURATIONS #================================================= -# RESTORE THE PHP-FPM CONFIGURATION -#================================================= ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" +ynh_restore_file --origin_path="/etc/systemd/system/$app.service" +systemctl enable $app.service --quiet + +mkdir -p "/var/log/$app" +chown -R $app:$app "/var/log/$app" +ynh_restore_file --origin_path="/etc/logrotate.d/$app" + +yunohost service add $app --description="Bonfire daemon" --log="/var/log/$app/$app.log" + +#================================================= +# START SYSTEMD SERVICE +#================================================= +ynh_script_progression --message="Starting Bonfire daemon service..." --weight=1 + +ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" + +ynh_systemd_action --service_name=nginx --action=reload + #================================================= # GENERIC FINALIZATION #=================================================