diff --git a/pkg/image/service/service.go b/pkg/image/service/service.go index 09579e38cf..77a57006d8 100644 --- a/pkg/image/service/service.go +++ b/pkg/image/service/service.go @@ -176,9 +176,9 @@ func StartService() { if options.Options.EnableTorrentService { torrent.StopTorrents() } - if options.Options.StorageDriver == api.IMAGE_STORAGE_DRIVER_S3 { - procutils.NewCommand("umount", options.Options.S3MountPoint).Run() - } + //if options.Options.StorageDriver == api.IMAGE_STORAGE_DRIVER_S3 { + // procutils.NewCommand("umount", options.Options.S3MountPoint).Run() + //} }) } diff --git a/pkg/util/procutils/cmdsetenv_others.go b/pkg/util/procutils/cmdsetenv_others.go index 58a3d0a79d..3aa7f4e99c 100644 --- a/pkg/util/procutils/cmdsetenv_others.go +++ b/pkg/util/procutils/cmdsetenv_others.go @@ -18,8 +18,10 @@ package procutils import ( + "fmt" "os" "os/exec" + "strings" "yunion.io/x/executor/client" ) @@ -37,9 +39,19 @@ func cmdSetEnv(cmd *exec.Cmd) { ) } +var paths = []string{ + "/usr/bin", + "/usr/sbin", + "/usr/local/sbin", + "/usr/local/bin", + "/sbin", + "/bin", + "/opt/yunion/bin", +} + func remoteCmdSetEnv(cmd *client.Cmd) { - cmd.Env = append( - os.Environ(), - presetEnv..., - ) + envs := []string{ + fmt.Sprintf("PATH=%s", strings.Join(paths, ":")), + } + cmd.Env = append(envs, presetEnv...) }