diff --git a/libcontainer/factory_linux.go b/libcontainer/factory_linux.go index 7942533b..5eb561f6 100644 --- a/libcontainer/factory_linux.go +++ b/libcontainer/factory_linux.go @@ -39,6 +39,12 @@ func InitArgs(args ...string) func(*LinuxFactory) error { if lp, err := exec.LookPath(name); err == nil { name = lp } + } else { + abs, err := filepath.Abs(name) + if err != nil { + return err + } + name = abs } l.InitPath = name l.InitArgs = append([]string{name}, args[1:]...) diff --git a/main.go b/main.go index 144b6b3d..d4f507b9 100644 --- a/main.go +++ b/main.go @@ -2,7 +2,6 @@ package main import ( "os" - "path/filepath" "runtime" "github.com/Sirupsen/logrus" @@ -97,12 +96,6 @@ func main() { os.Exit(status) } - //allow for relative path for the runC binary - if absPath, err := filepath.Abs(os.Args[0]); err != nil { - logrus.Fatal("Cannot convert runc path to absolute: %v", err) - } else { - os.Args[0] = absPath - } if err := app.Run(os.Args); err != nil { logrus.Fatal(err) }