mirror of
https://github.com/Ascend/ascend-docker-runtime.git
synced 2025-10-06 02:36:50 +08:00
Match-id-aa9414be36c97beb23076851f9ad503951c01ac4
This commit is contained in:
@@ -13,6 +13,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path"
|
"path"
|
||||||
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
@@ -94,13 +95,17 @@ func initLogModule(stopCh <-chan struct{}) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var execRunc = func() error {
|
var execRunc = func() error {
|
||||||
runcPath, err := exec.LookPath(dockerRuncName)
|
tempRuncPath, err := exec.LookPath(dockerRuncName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
runcPath, err = exec.LookPath(runcName)
|
tempRuncPath, err = exec.LookPath(runcName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to find the path of runc: %v", err)
|
return fmt.Errorf("failed to find the path of runc: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
runcPath, err := filepath.EvalSymlinks(tempRuncPath)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("failed to find realpath of runc %v", err)
|
||||||
|
}
|
||||||
if _, err := mindxcheckutils.RealFileChecker(runcPath, true, false, mindxcheckutils.DefaultSize); err != nil {
|
if _, err := mindxcheckutils.RealFileChecker(runcPath, true, false, mindxcheckutils.DefaultSize); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user