fix(glance): donot umount s3fs on glance exit (#22037)

This commit is contained in:
wanyaoqi
2025-01-26 19:57:54 +08:00
committed by GitHub
parent 10dd582a83
commit dd75e4d4f9
2 changed files with 19 additions and 7 deletions
+3 -3
View File
@@ -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()
//}
})
}
+16 -4
View File
@@ -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...)
}