MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / runStart

Method runStart

internal/apps/app_cmd.go:190–215  ·  view source on GitHub ↗

启动

()

Source from the content-addressed store, hash-verified

188
189// 启动
190func (this *AppCmd) runStart() {
191 var pid = this.getPID()
192 if pid > 0 {
193 fmt.Println(this.product+" already started, pid:", pid)
194 return
195 }
196
197 _ = os.Setenv("EdgeBackground", "on")
198
199 var cmd = exec.Command(this.exe())
200 cmd.SysProcAttr = &syscall.SysProcAttr{
201 Foreground: false,
202 Setsid: true,
203 }
204
205 err := cmd.Start()
206 if err != nil {
207 fmt.Println(this.product+" start failed:", err.Error())
208 return
209 }
210
211 // create symbolic links
212 _ = this.createSymLinks()
213
214 fmt.Println(this.product+" started ok, pid:", cmd.Process.Pid)
215}
216
217// 停止
218func (this *AppCmd) runStop() {

Callers 2

RunMethod · 0.95
runRestartMethod · 0.95

Calls 5

getPIDMethod · 0.95
exeMethod · 0.95
createSymLinksMethod · 0.95
StartMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected