From 7c45a68870e142cee19600b5d5a03aebb554a1a0 Mon Sep 17 00:00:00 2001 From: 21pages Date: Wed, 19 Jun 2024 16:29:40 +0800 Subject: [PATCH] linux install service, stop service before start (#8414) If the stop-service option before installation is "", after installation --sever is also started up. When clicking to start service, restart --server to make it read the config file, otherwise the service can't be started util --server is restarted. Signed-off-by: 21pages --- src/platform/linux.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/linux.rs b/src/platform/linux.rs index a7fb22c48..cc0192fbf 100644 --- a/src/platform/linux.rs +++ b/src/platform/linux.rs @@ -1392,7 +1392,7 @@ pub fn install_service() -> bool { let cp = switch_service(false); let app_name = crate::get_app_name().to_lowercase(); if !run_cmds_pkexec(&format!( - "{cp} systemctl enable {app_name}; systemctl start {app_name};" + "{cp} systemctl enable {app_name}; systemctl stop {app_name}; systemctl start {app_name};" )) { Config::set_option("stop-service".into(), "Y".into()); return true;