Skip to content

Commit

Permalink
fix(glance): donot umount s3fs on glance exit (#22037)
Browse files Browse the repository at this point in the history
  • Loading branch information
wanyaoqi authored Jan 26, 2025
1 parent 10dd582 commit dd75e4d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
6 changes: 3 additions & 3 deletions pkg/image/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
//}
})
}

Expand Down
20 changes: 16 additions & 4 deletions pkg/util/procutils/cmdsetenv_others.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
package procutils

import (
"fmt"
"os"
"os/exec"
"strings"

"yunion.io/x/executor/client"
)
Expand All @@ -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...)
}

0 comments on commit dd75e4d

Please sign in to comment.