Documentation ¶
Overview ¶
Package procutils contains helpers and utilities for managing processes.
Index ¶
- func EnsureFakeRoot(interactive bool) (bool, error)
- func GetSubIDRanges() ([]string, []string, error)
- func GetUIDGID(username string) (int, int)
- func IsPidRunning(pid int) bool
- func RunDetached(cmd *exec.Cmd, logfile string) error
- func RunInteractive(cmd *exec.Cmd) error
- func RunWithTTY(cmd *exec.Cmd) error
- func SetProcessKeepIDMaps(cmd *exec.Cmd, uidMap, gidMap string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureFakeRoot ¶
EnsureFakeRoot will ensure process is executed with rootless-helper.
func GetSubIDRanges ¶
GetSubIDRanges will return a slice of subUIDs and subGIDs for running user. This function will use the "getsubids" program to discover them.
func GetUIDGID ¶
GetUIDGID will return a couple of uid/gid integers for input user. Input user can be in the form of username:group, or uid:gid or a mix of that.
func IsPidRunning ¶
IsPidRunning will return whether or not the input pid is actually alive and not stopped or a zombie process.
func RunDetached ¶
RunDetached will run input cmd and redurect all outputs to logfile. No stdin is set up.
func RunInteractive ¶
RunInteractive will run input cmd using main process' stdin, but pipe stdout/err to main.
This usually is used in combination with the ptyAgent inside a container.
func RunWithTTY ¶
RunWithTTY will run input cmd using main process' stdin/out/err.
Types ¶
This section is empty.