Make user specified tasks executable

This commit is contained in:
Alex Dadgar
2016-03-15 19:22:40 -07:00
parent 317915b834
commit 2db5b298aa
7 changed files with 88 additions and 13 deletions

View File

@@ -36,6 +36,18 @@ var (
}
)
func (e *UniversalExecutor) makeExecutable(binPath string) error {
path := binPath
if e.ctx.FSIsolation {
// The path must be relative the chroot
path = filepath.Join(e.taskDir, binPath)
} else if !filepath.IsAbs(binPath) {
// The path must be relative the allocations directory.
path = filepath.Join(e.taskDir, binPath)
}
return e.makeExecutablePosix(path)
}
// configureIsolation configures chroot and creates cgroups
func (e *UniversalExecutor) configureIsolation() error {
if e.ctx.FSIsolation {