diff --git a/scripts/install b/scripts/install index 23201c8..c7771f2 100644 --- a/scripts/install +++ b/scripts/install @@ -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" #================================================= diff --git a/scripts/remove b/scripts/remove index 0abfa5e..fe5a3a6 100644 --- a/scripts/remove +++ b/scripts/remove @@ -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 #================================================= diff --git a/scripts/restore b/scripts/restore index 5382ae0..63bb1d6 100644 --- a/scripts/restore +++ b/scripts/restore @@ -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 diff --git a/scripts/upgrade b/scripts/upgrade index 0040219..38b44a2 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -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 #=================================================