procfs

package
v1.32.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2024 License: Apache-2.0 Imports: 13 Imported by: 285

Documentation

Overview

Package procfs implements utility functions relating to the /proc mount.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PKill added in v1.4.0

func PKill(name string, sig syscall.Signal) error

PKill finds process(es) using a regular expression and send a specified signal to each process.

func PidOf added in v1.4.0

func PidOf(name string) ([]int, error)

PidOf finds process(es) with a specified name (regexp match) and return their pid(s).

Types

type FakeProcFS added in v1.2.0

type FakeProcFS struct{}

func (*FakeProcFS) GetFullContainerName added in v1.2.0

func (fakePfs *FakeProcFS) GetFullContainerName(pid int) (string, error)

GetFullContainerName gets the container name given the root process id of the container. E.g. if the devices cgroup for the container is stored in /sys/fs/cgroup/devices/docker/nginx, return docker/nginx. Assumes that the process is part of exactly one cgroup hierarchy.

type ProcFS added in v1.2.0

type ProcFS struct{}

ProcFS provides a helper for getting container name via pid.

func (*ProcFS) GetFullContainerName added in v1.2.0

func (pfs *ProcFS) GetFullContainerName(pid int) (string, error)

GetFullContainerName gets the container name given the root process id of the container. E.g. if the devices cgroup for the container is stored in /sys/fs/cgroup/devices/docker/nginx, return docker/nginx. Assumes that the process is part of exactly one cgroup hierarchy.

type ProcFSInterface added in v1.2.0

type ProcFSInterface interface {
	// GetFullContainerName gets the container name given the root process id of the container.
	GetFullContainerName(pid int) (string, error)
}

Jump to

Keyboard shortcuts

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