MCPcopy
hub / github.com/NVIDIA/aistore / startNode

Function startNode

devtools/tutils/node.go:392–413  ·  view source on GitHub ↗
(cmd string, args []string, asPrimary bool)

Source from the content-addressed store, hash-verified

390}
391
392func startNode(cmd string, args []string, asPrimary bool) (pid int, err error) {
393 ncmd := exec.Command(cmd, args...)
394 // When using Ctrl-C on test, children (restored daemons) should not be
395 // killed as well.
396 // (see: https://groups.google.com/forum/#!topic/golang-nuts/shST-SDqIp4)
397 ncmd.SysProcAttr = &syscall.SysProcAttr{
398 Setpgid: true,
399 }
400 if asPrimary {
401 // Sets the environment variable to start as primary proxy to true
402 environ := os.Environ()
403 environ = append(environ, fmt.Sprintf("%s=true", env.AIS.IsPrimary))
404 ncmd.Env = environ
405 }
406
407 if err = ncmd.Start(); err != nil {
408 return
409 }
410 pid = ncmd.Process.Pid
411 err = ncmd.Process.Release()
412 return
413}
414
415func DeployNode(t *testing.T, node *cluster.Snode, conf *cmn.Config, localConf *cmn.LocalConfig) int {
416 conf.ConfigDir = t.TempDir()

Callers 2

RestoreNodeFunction · 0.85
DeployNodeFunction · 0.85

Calls 2

StartMethod · 0.65
ReleaseMethod · 0.45

Tested by

no test coverage detected