1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/ffsync_ynh.git synced 2024-09-03 18:26:38 +02:00

Do not name services something.service ...

This commit is contained in:
Alexandre Aubin 2020-05-23 20:57:23 +02:00 committed by Josue-T
parent 3a85d16ec4
commit b6f62df85a
4 changed files with 15 additions and 6 deletions

View file

@ -134,7 +134,7 @@ set_permissions
#=================================================
ynh_print_info --message="Integrating service in YunoHost..."
yunohost service add "uwsgi-app@$app.service" --log "/var/log/uwsgi/app/$app"
yunohost service add "uwsgi-app@$app" --log "/var/log/uwsgi/app/$app"
#=================================================

View file

@ -29,10 +29,10 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
# 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 >/dev/null
if ynh_exec_warn_less yunohost service status uwsgi-app@$app >/dev/null
then
ynh_print_info --message="Removing $app service..."
yunohost service remove uwsgi-app@$app.service
yunohost service remove uwsgi-app@$app
fi
#=================================================

View file

@ -81,12 +81,12 @@ ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
yunohost service add "uwsgi-app@$app.service" --log "/var/log/uwsgi/app/$app"
yunohost service add "uwsgi-app@$app" --log "/var/log/uwsgi/app/$app"
ynh_script_progression --message="Reloading services..." --weight=3
ynh_check_global_uwsgi_config
systemctl enable "uwsgi-app@$app.service"
systemctl enable "uwsgi-app@$app"
#=================================================
# GENERIC FINALIZATION
@ -94,7 +94,7 @@ systemctl enable "uwsgi-app@$app.service"
# RELOAD NGINX AND UWSGI
#=================================================
systemctl start "uwsgi-app@$app.service"
systemctl start "uwsgi-app@$app"
systemctl reload nginx
ynh_script_progression --message="Restoration completed for $app" --last

View file

@ -68,6 +68,15 @@ if [ -e /etc/init.d/ffsync ]; then
yunohost service remove "$app"
fi
# Remove old service ending with ".service"
if ynh_exec_warn_less yunohost service status "uwsgi-app@$app.service" >/dev/null
then
yunohost service remove uwsgi-app@$app.service
fi
yunohost service add "uwsgi-app@$app" --log "/var/log/uwsgi/app/$app"
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================