(stateDir string)
| 52 | } |
| 53 | |
| 54 | func RootlessKitChildPid(stateDir string) (int, error) { |
| 55 | pidFilePath := filepath.Join(stateDir, "child_pid") |
| 56 | if _, err := os.Stat(pidFilePath); err != nil { |
| 57 | return 0, err |
| 58 | } |
| 59 | |
| 60 | pidFileBytes, err := filesystem.ReadFile(pidFilePath) |
| 61 | if err != nil { |
| 62 | return 0, err |
| 63 | } |
| 64 | pidStr := strings.TrimSpace(string(pidFileBytes)) |
| 65 | return strconv.Atoi(pidStr) |
| 66 | } |
| 67 | |
| 68 | func ParentMain(hostGatewayIP string) error { |
| 69 | if !IsRootlessParent() { |
no test coverage detected
searching dependent graphs…