mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-27 01:50:30 +08:00
优化系统服务逻辑
This commit is contained in:
@@ -14,6 +14,7 @@ import (
|
||||
"os"
|
||||
"os/exec"
|
||||
"runtime"
|
||||
"time"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -94,6 +95,12 @@ func (this *SystemServiceManager) setupSystemd(params maps.Map) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// 启动Service
|
||||
go func() {
|
||||
time.Sleep(5 * time.Second)
|
||||
_ = exec.Command(systemctl, "start", teaconst.SystemdServiceName).Start()
|
||||
}()
|
||||
|
||||
if output == "enabled" {
|
||||
// 检查文件路径是否变化
|
||||
data, err := ioutil.ReadFile("/etc/systemd/system/" + teaconst.SystemdServiceName + ".service")
|
||||
|
||||
Reference in New Issue
Block a user