diff --git a/internal/utils/service_linux.go b/internal/utils/service_linux.go index 9e8156c..3228c04 100644 --- a/internal/utils/service_linux.go +++ b/internal/utils/service_linux.go @@ -115,6 +115,12 @@ func (this *ServiceManager) installSystemdService(systemd, exePath string, args var shortName = teaconst.SystemdServiceName var longName = "GoEdge Node" // TODO 将来可以修改 + var startCmd = exePath + " daemon" + bashPath, _ := executils.LookPath("bash") + if len(bashPath) > 0 { + startCmd = bashPath + " -c \"" + startCmd + "\"" + } + var desc = `### BEGIN INIT INFO # Provides: ` + shortName + ` # Required-Start: $all @@ -133,7 +139,7 @@ After=network-online.target Type=simple Restart=always RestartSec=1s -ExecStart=` + exePath + ` daemon +ExecStart=` + startCmd + ` ExecStop=` + exePath + ` stop ExecReload=` + exePath + ` reload