1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/funkwhale_ynh.git synced 2024-09-03 18:36:24 +02:00

Better service name

This commit is contained in:
yalh76 2021-04-06 01:17:48 +02:00
parent 865f0cde0f
commit dba44f012d
5 changed files with 33 additions and 33 deletions

View file

@ -69,9 +69,9 @@ ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf"
# BACKUP SYSTEMD
#=================================================
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}-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"
#=================================================

View file

@ -179,9 +179,9 @@ ynh_script_progression --message="Configuring a systemd service..."
ynh_add_config --template="../conf/funkwhale.target" --destination="/etc/systemd/system/$app.target"
# Create a dedicated systemd config
ynh_add_systemd_config --service="$app-server" --template="funkwhale-server.service" --others_var="datadir"
ynh_add_systemd_config --service="$app-worker" --template="funkwhale-worker.service" --others_var="datadir"
ynh_add_systemd_config --service="$app-beat" --template="funkwhale-beat.service" --others_var="datadir"
ynh_add_systemd_config --service="${app}-server" --template="funkwhale-server.service" --others_var="datadir"
ynh_add_systemd_config --service="${app}-worker" --template="funkwhale-worker.service" --others_var="datadir"
ynh_add_systemd_config --service="${app}-beat" --template="funkwhale-beat.service" --others_var="datadir"
#=================================================
# GENERIC FINALIZATION

View file

@ -30,22 +30,22 @@ redis_db=$(ynh_app_setting_get --app=$app --key=redis_db)
#=================================================
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
if ynh_exec_warn_less yunohost service status "$app-server" >/dev/null
if ynh_exec_warn_less yunohost service status "${app}-server" >/dev/null
then
ynh_script_progression --message="Removing $app-server service integration..."
yunohost service remove "$app-server"
ynh_script_progression --message="Removing ${app}-server service integration..."
yunohost service remove "${app}-server"
fi
if ynh_exec_warn_less yunohost service status "$app-worker" >/dev/null
if ynh_exec_warn_less yunohost service status "${app}-worker" >/dev/null
then
ynh_script_progression --message="Removing $app-worker service integration..."
yunohost service remove "$app-worker"
ynh_script_progression --message="Removing ${app}-worker service integration..."
yunohost service remove "${app}-worker"
fi
if ynh_exec_warn_less yunohost service status "$app-beat" >/dev/null
if ynh_exec_warn_less yunohost service status "${app}-beat" >/dev/null
then
ynh_script_progression --message="Removing $app-beat service integration..."
yunohost service remove "$app-beat"
ynh_script_progression --message="Removing ${app}-beat service integration..."
yunohost service remove "${app}-beat"
fi
#=================================================
@ -53,14 +53,14 @@ fi
#=================================================
ynh_script_progression --message="Stopping and removing the systemd service..."
ynh_systemd_action --action="stop" --service_name="${app}-beat" --log_path="systemd" --line_match="Stopped Funkwhale"
ynh_systemd_action --action="stop" --service_name="${app}-server" --log_path="systemd" --line_match="Stopped Funkwhale"
ynh_systemd_action --action="stop" --service_name="${app}-worker" --log_path="systemd" --line_match="Stopped Funkwhale"
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="$app-server"
ynh_remove_systemd_config --service="$app-worker"
ynh_remove_systemd_config --service="$app-beat"
ynh_remove_systemd_config --service="${app}-beat"
ynh_remove_systemd_config --service="${app}-server"
ynh_remove_systemd_config --service="${app}-worker"
ynh_secure_remove --file="/etc/systemd/system/$app.target"

View file

@ -118,14 +118,14 @@ ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name
#=================================================
ynh_script_progression --message="Restoring the systemd configuration..."
ynh_restore_file --origin_path="/etc/systemd/system/$app-beat.service"
ynh_restore_file --origin_path="/etc/systemd/system/$app-server.service"
ynh_restore_file --origin_path="/etc/systemd/system/$app-worker.service"
ynh_restore_file --origin_path="/etc/systemd/system/${app}-beat.service"
ynh_restore_file --origin_path="/etc/systemd/system/${app}-server.service"
ynh_restore_file --origin_path="/etc/systemd/system/${app}-worker.service"
ynh_restore_file --origin_path="/etc/systemd/system/$app.target"
systemctl enable "$app-beat.service" --quiet
systemctl enable "$app-server.service" --quiet
systemctl enable "$app-worker.service" --quiet
systemctl enable "${app}-beat.service" --quiet
systemctl enable "${app}-server.service" --quiet
systemctl enable "${app}-worker.service" --quiet
#=================================================
# INTEGRATE SERVICE IN YUNOHOST

View file

@ -75,9 +75,9 @@ ynh_abort_if_errors
#=================================================
ynh_script_progression --message="Stopping a systemd service..."
ynh_systemd_action --action="stop" --service_name="${app}-beat" --log_path="systemd" --line_match="Stopped Funkwhale"
ynh_systemd_action --action="stop" --service_name="${app}-server" --log_path="systemd" --line_match="Stopped Funkwhale"
ynh_systemd_action --action="stop" --service_name="${app}-worker" --log_path="systemd" --line_match="Stopped Funkwhale"
ynh_systemd_action --action="stop" --service_name="${app}-beat" --log_path="systemd" --line_match="Stopped $app"
ynh_systemd_action --action="stop" --service_name="${app}-server" --log_path="systemd" --line_match="Stopped $app"
ynh_systemd_action --action="stop" --service_name="${app}-worker" --log_path="systemd" --line_match="Stopped $app"
#=================================================
# MOVE DATAS
@ -208,9 +208,9 @@ ynh_script_progression --message="Upgrading systemd configuration..."
ynh_add_config --template="../conf/funkwhale.target" --destination="/etc/systemd/system/$app.target"
# Create a dedicated systemd config
ynh_add_systemd_config --service="$app-server" --template="funkwhale-server.service" --others_var="datadir"
ynh_add_systemd_config --service="$app-worker" --template="funkwhale-worker.service" --others_var="datadir"
ynh_add_systemd_config --service="$app-beat" --template="funkwhale-beat.service" --others_var="datadir"
ynh_add_systemd_config --service="${app}-server" --template="funkwhale-server.service" --others_var="datadir"
ynh_add_systemd_config --service="${app}-worker" --template="funkwhale-worker.service" --others_var="datadir"
ynh_add_systemd_config --service="${app}-beat" --template="funkwhale-beat.service" --others_var="datadir"
#=================================================
# GENERIC FINALIZATION