github.com/ryanslade/nomad@v0.2.4-0.20160128061903-fc95782f2089/command/spawn_daemon_linux.go (about) 1 package command 2 3 import "syscall" 4 5 // configureChroot enters the user command into a chroot if specified in the 6 // config and on an OS that supports Chroots. 7 func (c *SpawnDaemonCommand) configureChroot() { 8 if len(c.config.Chroot) != 0 { 9 if c.config.Cmd.SysProcAttr == nil { 10 c.config.Cmd.SysProcAttr = &syscall.SysProcAttr{} 11 } 12 13 c.config.Cmd.SysProcAttr.Chroot = c.config.Chroot 14 c.config.Cmd.Dir = "/" 15 } 16 }