github.com/ryanslade/nomad@v0.2.4-0.20160128061903-fc95782f2089/command/spawn_daemon_unix.go (about)

     1  // +build !windows
     2  
     3  package command
     4  
     5  import "syscall"
     6  
     7  // isolateCmd sets the session id for the process and the umask.
     8  func (c *SpawnDaemonCommand) isolateCmd() error {
     9  	if c.config.Cmd.SysProcAttr == nil {
    10  		c.config.Cmd.SysProcAttr = &syscall.SysProcAttr{}
    11  	}
    12  
    13  	c.config.Cmd.SysProcAttr.Setsid = true
    14  	syscall.Umask(0)
    15  	return nil
    16  }