install service period protection

how to reproduce:
install, click stop service, click start service and click no
on uac, it'll show "Service is not running" but can be connected.

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2023-09-11 16:04:51 +08:00
parent e98aa81794
commit d0173fbdc5
4 changed files with 30 additions and 2 deletions

View File

@@ -1074,7 +1074,7 @@ mod desktop {
pub fn refresh(&mut self) {
if !self.sid.is_empty() && is_active_and_seat0(&self.sid) {
return;
return;
}
let seat0_values = get_values_of_seat0(&[0, 1, 2]);
@@ -1183,6 +1183,7 @@ pub fn uninstall_service(show_new_window: bool) -> bool {
}
pub fn install_service() -> bool {
let _installing = crate::platform::InstallingService::new();
if !has_cmd("systemctl") {
return false;
}