mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-03 15:00:27 +08:00
优化systemd服务配置
This commit is contained in:
@@ -113,6 +113,12 @@ func (this *ServiceManager) installSystemdService(systemd, exePath string, args
|
|||||||
shortName := teaconst.SystemdServiceName
|
shortName := teaconst.SystemdServiceName
|
||||||
longName := "GoEdge API" // TODO 将来可以修改
|
longName := "GoEdge API" // TODO 将来可以修改
|
||||||
|
|
||||||
|
var startCmd = exePath + " daemon"
|
||||||
|
bashPath, _ := executils.LookPath("bash")
|
||||||
|
if len(bashPath) > 0 {
|
||||||
|
startCmd = bashPath + " -c \"" + startCmd + "\""
|
||||||
|
}
|
||||||
|
|
||||||
desc := `### BEGIN INIT INFO
|
desc := `### BEGIN INIT INFO
|
||||||
# Provides: ` + shortName + `
|
# Provides: ` + shortName + `
|
||||||
# Required-Start: $all
|
# Required-Start: $all
|
||||||
@@ -131,7 +137,7 @@ After=network-online.target
|
|||||||
Type=simple
|
Type=simple
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=1s
|
RestartSec=1s
|
||||||
ExecStart=` + exePath + ` daemon
|
ExecStart=` + startCmd + `
|
||||||
ExecStop=` + exePath + ` stop
|
ExecStop=` + exePath + ` stop
|
||||||
ExecReload=` + exePath + ` reload
|
ExecReload=` + exePath + ` reload
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user