From 7abf2cbf0e98edc7c00cbb04f066304629dfe1f6 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Fri, 10 Nov 2023 19:46:24 +0100 Subject: [PATCH] fix services names --- ...wyrm-beat.service => __APP__-beat.service} | 0 ...-server.service => __APP__-server.service} | 0 ...-worker.service => __APP__-worker.service} | 0 conf/{bookwyrm.target => __APP__.target} | 0 manifest.toml | 2 +- scripts/backup | 8 ++++---- scripts/install | 20 +++++++++---------- scripts/remove | 14 ++++++------- scripts/restore | 12 +++++------ scripts/upgrade | 18 ++++++++--------- 10 files changed, 37 insertions(+), 37 deletions(-) rename conf/{bookwyrm-beat.service => __APP__-beat.service} (100%) rename conf/{bookwyrm-server.service => __APP__-server.service} (100%) rename conf/{bookwyrm-worker.service => __APP__-worker.service} (100%) rename conf/{bookwyrm.target => __APP__.target} (100%) diff --git a/conf/bookwyrm-beat.service b/conf/__APP__-beat.service similarity index 100% rename from conf/bookwyrm-beat.service rename to conf/__APP__-beat.service diff --git a/conf/bookwyrm-server.service b/conf/__APP__-server.service similarity index 100% rename from conf/bookwyrm-server.service rename to conf/__APP__-server.service diff --git a/conf/bookwyrm-worker.service b/conf/__APP__-worker.service similarity index 100% rename from conf/bookwyrm-worker.service rename to conf/__APP__-worker.service diff --git a/conf/bookwyrm.target b/conf/__APP__.target similarity index 100% rename from conf/bookwyrm.target rename to conf/__APP__.target diff --git a/manifest.toml b/manifest.toml index 8ef0fda..3251996 100644 --- a/manifest.toml +++ b/manifest.toml @@ -69,7 +69,7 @@ ram.runtime = "50M" main.default = 8000 [resources.apt] - packages = "postgresql, postgresql-contrib, python3-venv, libpq-dev, python3-dev" + packages = "postgresql, postgresql-contrib, python3-venv, libpq-dev, python3-pip, python3-dev, libpq-dev" [resources.database] type = "postgresql" diff --git a/scripts/backup b/scripts/backup index e7c53ce..1187a94 100755 --- a/scripts/backup +++ b/scripts/backup @@ -31,10 +31,10 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" # BACKUP SYSTEMD #================================================= -ynh_backup --src_path="/etc/systemd/system/bookwyrm-beat.service" -ynh_backup --src_path="/etc/systemd/system/bookwyrm-server.service" -ynh_backup --src_path="/etc/systemd/system/bookwyrm-worker.service" -ynh_backup --src_path="/etc/systemd/system/bookwyrm.target" +ynh_backup --src_path="/etc/systemd/system/$app-beat.service" +ynh_backup --src_path="/etc/systemd/system/$app-server.service" +ynh_backup --src_path="/etc/systemd/system/$app-worker.service" +ynh_backup --src_path="/etc/systemd/system/$app.target" #================================================= # BACKUP THE POSTGRESQL DATABASE diff --git a/scripts/install b/scripts/install index 2be83bd..5131411 100755 --- a/scripts/install +++ b/scripts/install @@ -75,12 +75,12 @@ chown -R $app:www-data /var/log/$app/ #================================================= ynh_script_progression --message="Configuring a systemd service..." --weight=1 -ynh_add_config --template="../conf/bookwyrm.target" --destination="/etc/systemd/system/bookwyrm.target" +ynh_add_config --template="../conf/$app.target" --destination="/etc/systemd/system/$app.target" # Create a dedicated systemd config -ynh_add_systemd_config --service="bookwyrm-server" --template="bookwyrm-server.service" -ynh_add_systemd_config --service="bookwyrm-worker" --template="bookwyrm-worker.service" -ynh_add_systemd_config --service="bookwyrm-beat" --template="bookwyrm-beat.service" +ynh_add_systemd_config --service="$app-server" --template="$app-server.service" +ynh_add_systemd_config --service="$app-worker" --template="$app-worker.service" +ynh_add_systemd_config --service="$app-beat" --template="$app-beat.service" #================================================= # GENERIC FINALIZATION @@ -89,9 +89,9 @@ ynh_add_systemd_config --service="bookwyrm-beat" --template="bookwyrm-beat.ser #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add "bookwyrm-beat" --log="/var/log/$app/$app-beat.log" -yunohost service add "bookwyrm-server" --log="/var/log/$app/$app.log" -yunohost service add "bookwyrm-worker" --log="/var/log/$app/$app-worker.log" +yunohost service add "$app-beat" --log="/var/log/$app/$app-beat.log" +yunohost service add "$app-server" --log="/var/log/$app/$app.log" +yunohost service add "$app-worker" --log="/var/log/$app/$app-worker.log" #================================================= # START SYSTEMD SERVICE @@ -99,9 +99,9 @@ yunohost service add "bookwyrm-worker" --log="/var/log/$app/$app-worker.log" ynh_script_progression --message="Starting a systemd service..." --weight=1 # Start a systemd service -ynh_systemd_action --service_name="bookwyrm-beat" --action="start" --log_path="systemd" --line_match="Started" -ynh_systemd_action --service_name="bookwyrm-server" --action="start" --log_path="systemd" --line_match="Booting worker with pid" -ynh_systemd_action --service_name="bookwyrm-worker" --action="start" --log_path="systemd" --line_match="ready" +ynh_systemd_action --service_name="$app-beat" --action="start" --log_path="systemd" --line_match="Started" +ynh_systemd_action --service_name="$app-server" --action="start" --log_path="systemd" --line_match="Booting worker with pid" +ynh_systemd_action --service_name="$app-worker" --action="start" --log_path="systemd" --line_match="ready" #================================================= # END OF SCRIPT diff --git a/scripts/remove b/scripts/remove index 2618d60..3c43ab7 100644 --- a/scripts/remove +++ b/scripts/remove @@ -28,16 +28,16 @@ fi #================================================= ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1 -ynh_systemd_action --service_name="bookwyrm-beat" --action="stop" --log_path="systemd" --line_match="Stopped $app" -ynh_systemd_action --service_name="bookwyrm-server" --action="stop" --log_path="systemd" --line_match="Stopped $app" -ynh_systemd_action --service_name="bookwyrm-worker" --action="stop" --log_path="systemd" --line_match="Stopped $app" +ynh_systemd_action --service_name="$app-beat" --action="stop" --log_path="systemd" --line_match="Stopped $app" +ynh_systemd_action --service_name="$app-server" --action="stop" --log_path="systemd" --line_match="Stopped $app" +ynh_systemd_action --service_name="$app-worker" --action="stop" --log_path="systemd" --line_match="Stopped $app" # Remove the dedicated systemd config -ynh_remove_systemd_config --service="bookwyrm-beat" --log="/var/log/$app/$app-beat.log" -ynh_remove_systemd_config --service="bookwyrm-server" --log="/var/log/$app/$app.log" -ynh_remove_systemd_config --service="bookwyrm-worker" --log="/var/log/$app/$app-worker.log" +ynh_remove_systemd_config --service="$app-beat" --log="/var/log/$app/$app-beat.log" +ynh_remove_systemd_config --service="$app-server" --log="/var/log/$app/$app.log" +ynh_remove_systemd_config --service="$app-worker" --log="/var/log/$app/$app-worker.log" -ynh_secure_remove --file="/etc/systemd/system/bookwyrm.target" +ynh_secure_remove --file="/etc/systemd/system/$app.target" #================================================= # REMOVE APP MAIN DIR diff --git a/scripts/restore b/scripts/restore index 0baaefc..0113f4b 100644 --- a/scripts/restore +++ b/scripts/restore @@ -58,18 +58,18 @@ systemctl enable "bookwyrm-worker.service" --quiet #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add "bookwyrm-beat" --log="/var/log/$app/$app-beat.log" -yunohost service add "bookwyrm-server" --log="/var/log/$app/$app.log" -yunohost service add "bookwyrm-worker" --log="/var/log/$app/$app-worker.log" +yunohost service add "$app-beat" --log="/var/log/$app/$app-beat.log" +yunohost service add "$app-server" --log="/var/log/$app/$app.log" +yunohost service add "$app-worker" --log="/var/log/$app/$app-worker.log" #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name="bookwyrm-beat" --action="start" --log_path="systemd" --line_match="Started" -ynh_systemd_action --service_name="bookwyrm-server" --action="start" --log_path="systemd" --line_match="Booting worker with pid" -ynh_systemd_action --service_name="bookwyrm-worker" --action="start" --log_path="systemd" --line_match="ready" +ynh_systemd_action --service_name="$app-beat" --action="start" --log_path="systemd" --line_match="Started" +ynh_systemd_action --service_name="$app-server" --action="start" --log_path="systemd" --line_match="Booting worker with pid" +ynh_systemd_action --service_name="$app-worker" --action="start" --log_path="systemd" --line_match="ready" #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index 6109662..c0566f6 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -92,9 +92,9 @@ ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 ynh_add_config --template="../conf/bookwyrm.target" --destination="/etc/systemd/system/$app.target" # Create a dedicated systemd config -ynh_add_systemd_config --service="bookwyrm-server" --template="bookwyrm-server.service" -ynh_add_systemd_config --service="bookwyrm-worker" --template="bookwyrm-worker.service" -ynh_add_systemd_config --service="bookwyrm-beat" --template="bookwyrm-beat.service" +ynh_add_systemd_config --service="$app-server" --template="$app-server.service" +ynh_add_systemd_config --service="$app-worker" --template="$app-worker.service" +ynh_add_systemd_config --service="$app-beat" --template="$app-beat.service" #================================================= # GENERIC FINALIZATION @@ -103,18 +103,18 @@ ynh_add_systemd_config --service="bookwyrm-beat" --template="bookwyrm-beat.ser #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add "bookwyrm-beat" --log="/var/log/$app/$app-beat.log" -yunohost service add "bookwyrm-server" --log="/var/log/$app/$app.log" -yunohost service add "bookwyrm-worker" --log="/var/log/$app/$app-worker.log" +yunohost service add "$app-beat" --log="/var/log/$app/$app-beat.log" +yunohost service add "$app-server" --log="/var/log/$app/$app.log" +yunohost service add "$app-worker" --log="/var/log/$app/$app-worker.log" #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name="bookwyrm-beat" --action="start" --log_path="systemd" --line_match="Started" -ynh_systemd_action --service_name="bookwyrm-server" --action="start" --log_path="systemd" --line_match="Booting worker with pid" -ynh_systemd_action --service_name="bookwyrm-worker" --action="start" --log_path="systemd" --line_match="ready" +ynh_systemd_action --service_name="$app-beat" --action="start" --log_path="systemd" --line_match="Started" +ynh_systemd_action --service_name="$app-server" --action="start" --log_path="systemd" --line_match="Booting worker with pid" +ynh_systemd_action --service_name="$app-worker" --action="start" --log_path="systemd" --line_match="ready" #================================================= # END OF SCRIPT