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 <sunboeasy@gmail.com>
This commit is contained in:
parent
99edab4b61
commit
7c45a68870
@ -1392,7 +1392,7 @@ pub fn install_service() -> bool {
|
|||||||
let cp = switch_service(false);
|
let cp = switch_service(false);
|
||||||
let app_name = crate::get_app_name().to_lowercase();
|
let app_name = crate::get_app_name().to_lowercase();
|
||||||
if !run_cmds_pkexec(&format!(
|
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());
|
Config::set_option("stop-service".into(), "Y".into());
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user