open-nomad/client/driver/executor/checks_linux.go

17 lines
260 B
Go
Raw Normal View History

package executor
import (
"os/exec"
"syscall"
)
func (e *ExecScriptCheck) setChroot(cmd *exec.Cmd) {
if e.FSIsolation {
if cmd.SysProcAttr == nil {
cmd.SysProcAttr = &syscall.SysProcAttr{}
}
2016-03-24 23:33:04 +00:00
cmd.SysProcAttr.Chroot = e.taskDir
}
cmd.Dir = "/"
}