MCPcopy Create free account
hub / github.com/containerd/nerdctl / RootlessKitStateDir

Function RootlessKitStateDir

pkg/rootlessutil/parent_linux.go:38–52  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

36}
37
38func RootlessKitStateDir() (string, error) {
39 if v := os.Getenv("ROOTLESSKIT_STATE_DIR"); v != "" {
40 return v, nil
41 }
42 xdr, err := XDGRuntimeDir()
43 if err != nil {
44 return "", err
45 }
46 // "${XDG_RUNTIME_DIR}/containerd-rootless" is hardcoded in containerd-rootless.sh
47 stateDir := filepath.Join(xdr, "containerd-rootless")
48 if _, err := os.Stat(stateDir); err != nil {
49 return "", err
50 }
51 return stateDir, nil
52}
53
54func RootlessKitChildPid(stateDir string) (int, error) {
55 pidFilePath := filepath.Join(stateDir, "child_pid")

Callers 4

ParentMainFunction · 0.85
NewRootlessKitClientFunction · 0.85
DetachedNetNSFunction · 0.85

Calls 2

StatMethod · 0.80
XDGRuntimeDirFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…