From 79f1e5a2a13c08f22ae43cff182855815f1c0c84 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Tue, 7 Jul 2020 17:06:58 +0200 Subject: [PATCH 1/4] Fix regression about lock issues by removing the need to call yunohost commands from inside the service script --- conf/ynh-hotspot | 22 ++++++++++++++++++---- scripts/install | 2 +- scripts/restore | 2 +- scripts/upgrade | 2 +- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/conf/ynh-hotspot b/conf/ynh-hotspot index de0f730..b3b2a9a 100644 --- a/conf/ynh-hotspot +++ b/conf/ynh-hotspot @@ -256,11 +256,25 @@ ynh_setting_get() { } ynh_setting_set() { - app=${1} - setting=${2} - value=${3} - yunohost app setting "${app}" "${setting}" -v "${value}" + # This is a partial copypasta of the official ynh_app_setting internal helper + # In particular, we do this instead of relying on 'yunohost app setting' for + # performance reasons (it takes a few second to run every yunohost commands) + # and to remove the need for the infamous '--need-lock' option/issue. + + app="$1" key="$2" value="${3:-}" python2.7 - < Date: Tue, 7 Jul 2020 17:09:31 +0200 Subject: [PATCH 2/4] Bump package version --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index d3b5609..73c29b4 100644 --- a/manifest.json +++ b/manifest.json @@ -7,7 +7,7 @@ "fr": "Hotspot Wifi" }, "url": "https://github.com/labriqueinternet/hotspot_ynh", - "version": "1.2.0~ynh2", + "version": "1.2.0~ynh3", "license": "AGPL-3.0", "maintainer": { "name": "Julien Vaubourg", From d3eb54ad46c8c9fb9b28cdb22ea35f47c9c09d30 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Thu, 24 Sep 2020 00:04:31 +0200 Subject: [PATCH 3/4] No need to savagely restart php-fpm ... this dates back from the era were hotspot was run using admin --- conf/ynh-hotspot | 6 ------ 1 file changed, 6 deletions(-) diff --git a/conf/ynh-hotspot b/conf/ynh-hotspot index b3b2a9a..beb16a4 100644 --- a/conf/ynh-hotspot +++ b/conf/ynh-hotspot @@ -289,12 +289,6 @@ devfromid() { if [ "$1" != restart ]; then - # Restart php7.0-fpm at the first start (it needs to be restarted after the slapd start) - if [ ! -e /tmp/.ynh-hotspot-boot ]; then - touch /tmp/.ynh-hotspot-boot - systemctl restart php__PHPVERSION__-fpm - fi - # Variables echo -n "Retrieving Yunohost settings... " From 34abf5216239853b1066b7cebc75c2469db6d4ad Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Thu, 24 Sep 2020 00:05:30 +0200 Subject: [PATCH 4/4] No need to reload nginx/php-fpm, the helpers already handle it --- scripts/install | 8 -------- 1 file changed, 8 deletions(-) diff --git a/scripts/install b/scripts/install index b4e80cd..b20a680 100644 --- a/scripts/install +++ b/scripts/install @@ -323,14 +323,6 @@ else ynh_systemd_action --service_name=$service_name --action="start" --log_path=systemd #--line_match="Started YunoHost Wifi Hotspot" fi -#================================================= -# RELOAD NGINX AND PHP-FPM -#================================================= -ynh_script_progression --message="Reloading nginx web server..." - -ynh_systemd_action --service_name=php$phpversion-fpm --action=reload -ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #=================================================