From 2135084b8611ebdce2e8012d1f43f471ef9ea737 Mon Sep 17 00:00:00 2001 From: xSmurf Date: Mon, 15 Jun 2015 02:05:48 +0000 Subject: [PATCH] Fixed pwd when directory is not included in sandbox --- oz-init/init.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/oz-init/init.go b/oz-init/init.go index 18dcb10..3db3017 100644 --- a/oz-init/init.go +++ b/oz-init/init.go @@ -299,8 +299,13 @@ func (st *initState) launchApplication(pwd string, cmdArgs []string) (*exec.Cmd, Gid: uint32(st.gid), } cmd.Env = append(cmd.Env, st.launchEnv...) + cmd.Args = append(cmd.Args, cmdArgs...) - cmd.Dir = pwd + + if _, err := os.Stat(pwd); err == nil { + cmd.Dir = pwd + } + if err := cmd.Start(); err != nil { st.log.Warning("Failed to start application (%s): %v", st.profile.Path, err) return nil, err