MCPcopy
hub / github.com/syncthing/syncthing / Start

Method Start

lib/rc/rc.go:97–115  ·  view source on GitHub ↗

Start runs the specified Syncthing binary with the given arguments. Syncthing should be configured to provide an API on the address given to NewProcess. Event processing is started.

(bin string, args ...string)

Source from the content-addressed store, hash-verified

95// Syncthing should be configured to provide an API on the address given to
96// NewProcess. Event processing is started.
97func (p *Process) Start(bin string, args ...string) error {
98 cmd := exec.Command(bin, args...)
99 if p.logfd != nil {
100 cmd.Stdout = p.logfd
101 cmd.Stderr = p.logfd
102 }
103 cmd.Env = append(os.Environ(), "STNORESTART=1", "STGUIAPIKEY="+APIKey)
104
105 err := cmd.Start()
106 if err != nil {
107 return err
108 }
109
110 p.cmd = cmd
111 go p.eventLoop()
112 go p.wait()
113
114 return nil
115}
116
117func (p *Process) wait() {
118 p.cmd.Wait()

Callers 1

startInstanceFunction · 0.95

Calls 3

eventLoopMethod · 0.95
waitMethod · 0.95
StartMethod · 0.65

Tested by

no test coverage detected