procutils

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 11, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package procutils contains helpers and utilities for managing processes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureFakeRoot

func EnsureFakeRoot(interactive bool) (bool, error)

EnsureFakeRoot will ensure process is executed with rootless-helper.

func GetSubIDRanges

func GetSubIDRanges() ([]string, []string, error)

GetSubIDRanges will return a slice of subUIDs and subGIDs for running user. This function will use the "getsubids" program to discover them.

func GetUIDGID

func GetUIDGID(username string) (int, int)

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

func IsPidRunning(pid int) bool

IsPidRunning will return whether or not the input pid is actually alive and not stopped or a zombie process.

func RunDetached

func RunDetached(cmd *exec.Cmd, logfile string) error

RunDetached will run input cmd and redurect all outputs to logfile. No stdin is set up.

func RunInteractive

func RunInteractive(cmd *exec.Cmd) error

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

func RunWithTTY(cmd *exec.Cmd) error

RunWithTTY will run input cmd using main process' stdin/out/err.

func SetProcessKeepIDMaps

func SetProcessKeepIDMaps(cmd *exec.Cmd, uidMap, gidMap string) error

SetProcessKeepIDMaps will set child process uid/gid mappings.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL