diff --git a/conf/monitorix.conf b/conf/monitorix.conf index 483b9a9..a148440 100644 --- a/conf/monitorix.conf +++ b/conf/monitorix.conf @@ -22,7 +22,7 @@ include_dir = /etc/monitorix/conf.d base_dir = /var/lib/monitorix/www/ base_lib = /var/lib/monitorix/ base_url = __YNH_WWW_PATH__ -base_cgi = __YNH_WWW_PATH__-cgi +base_cgi = __YNH_WWW_PATH__/cgi enabled = y diff --git a/scripts/change_url b/scripts/change_url index f4f2564..8015e50 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -65,10 +65,17 @@ fi # Update Monitorix Config ynh_replace_string "base_url = $old_path" "base_url = $new_path" /etc/monitorix/monitorix.conf -ynh_replace_string "base_cgi = $old_path-cgi" "base_cgi = $new_path-cgi" /etc/monitorix/monitorix.conf +ynh_replace_string "base_cgi = $old_path/cgi" "base_cgi = $new_path/cgi" /etc/monitorix/monitorix.conf ynh_replace_string "url_prefix = http://127.0.0.1:$http_port$old_path" "url_prefix = http://127.0.0.1:$http_port$new_path" /etc/monitorix/monitorix.conf ynh_replace_string "from_address = noreply@$old_domain" "from_address = noreply@$new_domain" /etc/monitorix/monitorix.conf # Reload services sudo systemctl reload nginx.service -sudo systemctl restart monitorix.service \ No newline at end of file + +# Reload monitorix +# While we call "restart" sometime for unknown reason monitorix don't cleanly restart. Probably on the stop instruction the webserver is not stoped before the new start instruction. +# So this fix that +sudo systemctl stop monitorix.service +sleep 1 +sudo systemctl start monitorix.service +sleep 10 \ No newline at end of file diff --git a/scripts/install b/scripts/install index e84fecf..142efb9 100755 --- a/scripts/install +++ b/scripts/install @@ -65,5 +65,10 @@ set_permission # register yunohost service yunohost service add monitorix -# Reload services -systemctl restart monitorix.service +# Reload monitorix +# While we call "restart" sometime for unknown reason monitorix don't cleanly restart. Probably on the stop instruction the webserver is not stoped before the new start instruction. +# So this fix that +sudo systemctl stop monitorix.service +sleep 1 +sudo systemctl start monitorix.service +sleep 10 diff --git a/scripts/restore b/scripts/restore index 77a658f..7d0d157 100755 --- a/scripts/restore +++ b/scripts/restore @@ -51,5 +51,10 @@ set_permission # Reload nginx systemctl reload nginx.service -# Reload services -systemctl restart monitorix.service \ No newline at end of file +# Reload monitorix +# While we call "restart" sometime for unknown reason monitorix don't cleanly restart. Probably on the stop instruction the webserver is not stoped before the new start instruction. +# So this fix that +sudo systemctl stop monitorix.service +sleep 1 +sudo systemctl start monitorix.service +sleep 10 \ No newline at end of file diff --git a/scripts/upgrade b/scripts/upgrade index be7addb..2fdee74 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -59,5 +59,10 @@ cp ../conf/post_iptable_rules_hook /usr/share/yunohost/hooks/post_iptable_rules/ # Set access set_permission -# Reload services -systemctl start monitorix.service +# Reload monitorix +# While we call "restart" sometime for unknown reason monitorix don't cleanly restart. Probably on the stop instruction the webserver is not stoped before the new start instruction. +# So this fix that +sudo systemctl stop monitorix.service +sleep 1 +sudo systemctl start monitorix.service +sleep 10