fix services names

This commit is contained in:
Thomas 2023-11-10 19:46:24 +01:00 committed by GitHub
parent 68c0fe7d1e
commit 7abf2cbf0e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 37 additions and 37 deletions

View file

@ -69,7 +69,7 @@ ram.runtime = "50M"
main.default = 8000 main.default = 8000
[resources.apt] [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] [resources.database]
type = "postgresql" type = "postgresql"

View file

@ -31,10 +31,10 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
# BACKUP SYSTEMD # BACKUP SYSTEMD
#================================================= #=================================================
ynh_backup --src_path="/etc/systemd/system/bookwyrm-beat.service" ynh_backup --src_path="/etc/systemd/system/$app-beat.service"
ynh_backup --src_path="/etc/systemd/system/bookwyrm-server.service" ynh_backup --src_path="/etc/systemd/system/$app-server.service"
ynh_backup --src_path="/etc/systemd/system/bookwyrm-worker.service" ynh_backup --src_path="/etc/systemd/system/$app-worker.service"
ynh_backup --src_path="/etc/systemd/system/bookwyrm.target" ynh_backup --src_path="/etc/systemd/system/$app.target"
#================================================= #=================================================
# BACKUP THE POSTGRESQL DATABASE # BACKUP THE POSTGRESQL DATABASE

View file

@ -75,12 +75,12 @@ chown -R $app:www-data /var/log/$app/
#================================================= #=================================================
ynh_script_progression --message="Configuring a systemd service..." --weight=1 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 # Create a dedicated systemd config
ynh_add_systemd_config --service="bookwyrm-server" --template="bookwyrm-server.service" ynh_add_systemd_config --service="$app-server" --template="$app-server.service"
ynh_add_systemd_config --service="bookwyrm-worker" --template="bookwyrm-worker.service" ynh_add_systemd_config --service="$app-worker" --template="$app-worker.service"
ynh_add_systemd_config --service="bookwyrm-beat" --template="bookwyrm-beat.service" ynh_add_systemd_config --service="$app-beat" --template="$app-beat.service"
#================================================= #=================================================
# GENERIC FINALIZATION # 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 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 "$app-beat" --log="/var/log/$app/$app-beat.log"
yunohost service add "bookwyrm-server" --log="/var/log/$app/$app.log" yunohost service add "$app-server" --log="/var/log/$app/$app.log"
yunohost service add "bookwyrm-worker" --log="/var/log/$app/$app-worker.log" yunohost service add "$app-worker" --log="/var/log/$app/$app-worker.log"
#================================================= #=================================================
# START SYSTEMD SERVICE # 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 ynh_script_progression --message="Starting a systemd service..." --weight=1
# Start a systemd service # Start a systemd service
ynh_systemd_action --service_name="bookwyrm-beat" --action="start" --log_path="systemd" --line_match="Started" ynh_systemd_action --service_name="$app-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="$app-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-worker" --action="start" --log_path="systemd" --line_match="ready"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT

View file

@ -28,16 +28,16 @@ fi
#================================================= #=================================================
ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1 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="$app-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="$app-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-worker" --action="stop" --log_path="systemd" --line_match="Stopped $app"
# Remove the dedicated systemd config # Remove the dedicated systemd config
ynh_remove_systemd_config --service="bookwyrm-beat" --log="/var/log/$app/$app-beat.log" ynh_remove_systemd_config --service="$app-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="$app-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-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 # REMOVE APP MAIN DIR

View file

@ -58,18 +58,18 @@ systemctl enable "bookwyrm-worker.service" --quiet
#================================================= #=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 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 "$app-beat" --log="/var/log/$app/$app-beat.log"
yunohost service add "bookwyrm-server" --log="/var/log/$app/$app.log" yunohost service add "$app-server" --log="/var/log/$app/$app.log"
yunohost service add "bookwyrm-worker" --log="/var/log/$app/$app-worker.log" yunohost service add "$app-worker" --log="/var/log/$app/$app-worker.log"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1 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="$app-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="$app-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-worker" --action="start" --log_path="systemd" --line_match="ready"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION

View file

@ -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" ynh_add_config --template="../conf/bookwyrm.target" --destination="/etc/systemd/system/$app.target"
# Create a dedicated systemd config # Create a dedicated systemd config
ynh_add_systemd_config --service="bookwyrm-server" --template="bookwyrm-server.service" ynh_add_systemd_config --service="$app-server" --template="$app-server.service"
ynh_add_systemd_config --service="bookwyrm-worker" --template="bookwyrm-worker.service" ynh_add_systemd_config --service="$app-worker" --template="$app-worker.service"
ynh_add_systemd_config --service="bookwyrm-beat" --template="bookwyrm-beat.service" ynh_add_systemd_config --service="$app-beat" --template="$app-beat.service"
#================================================= #=================================================
# GENERIC FINALIZATION # 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 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 "$app-beat" --log="/var/log/$app/$app-beat.log"
yunohost service add "bookwyrm-server" --log="/var/log/$app/$app.log" yunohost service add "$app-server" --log="/var/log/$app/$app.log"
yunohost service add "bookwyrm-worker" --log="/var/log/$app/$app-worker.log" yunohost service add "$app-worker" --log="/var/log/$app/$app-worker.log"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1 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="$app-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="$app-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-worker" --action="start" --log_path="systemd" --line_match="ready"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT