From 1446e495dce3ab3e33c5b070313b278080340e07 Mon Sep 17 00:00:00 2001 From: Mario Fetka Date: Thu, 21 May 2026 16:17:35 +0200 Subject: [PATCH] activate control --- CMakeLists.txt | 6 +++++- smart.cmake | 5 ++++- static/start.html.cmake | 8 ++++---- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0879eb8..c6ef08e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,11 +10,15 @@ # Generated files ############## +# systemd itself is detected by the top-level systemdservice.cmake. +# This webui submodule only consumes WITH_SYSTEMD and SYSTEMD_SERVICES_INSTALL_DIR. if(NOT DEFINED MARS_NWE_SYSTEMD_SERVICE) set(MARS_NWE_SYSTEMD_SERVICE "mars-nwe-serv.service" CACHE STRING "MARS_NWE systemd service name") endif() -find_program(SYSTEMCTL_EXECUTABLE systemctl) +if(NOT DEFINED SYSTEMCTL_EXECUTABLE) + find_program(SYSTEMCTL_EXECUTABLE systemctl) +endif() if(NOT SYSTEMCTL_EXECUTABLE) set(SYSTEMCTL_EXECUTABLE "/usr/bin/systemctl") endif() diff --git a/smart.cmake b/smart.cmake index 37a2168..d80a58a 100644 --- a/smart.cmake +++ b/smart.cmake @@ -113,8 +113,11 @@ foreach $p ( @p ) } @c = split( '/', $c ); -if( $c[0] eq 'cgi-bin' && $c[1] eq 'control' ) +if( ( $c[0] eq 'service' && $c[1] eq 'control' ) || + ( $c[0] eq 'cgi-bin' && $c[1] eq 'control' ) ) { + # Service control must run before drop_root(). + # /service/control is the preferred path; /cgi-bin/control is kept as a legacy alias. $ENV{'QUERY_STRING'} = $cc; $ENV{'REQUEST_URI'} = $request_uri; $ENV{'SMART_SYSTEMCTL_PATH'} = $smart_systemctl_path if defined $smart_systemctl_path; diff --git a/static/start.html.cmake b/static/start.html.cmake index e3dbca7..34f192d 100644 --- a/static/start.html.cmake +++ b/static/start.html.cmake @@ -100,12 +100,12 @@
- - + + - - + +
Start MARS_NWEStop MARS_NWEStart MARS_NWEStop MARS_NWE
Restart MARS_NWEStatus MARS_NWERestart MARS_NWEStatus MARS_NWE