Documentation
¶
Index ¶
- func FlatChildTree(pid int, withRoot bool) ([]*process.Process, error)
- func GetTerm(pid int) (string, error)
- func Kill(pid int) error
- func KillWithContext(ctx context.Context, pid int) error
- func SendMessage(pid int, msg string) error
- func SendMessageWithContext(ctx context.Context, pid int, msg string) error
- func SendSigTerm(pid int) error
- func SendSigTermWithContext(ctx context.Context, pid int) error
- func SendSignal(pid int, sig syscall.Signal) error
- func SendSignalWithContext(ctx context.Context, pid int, sig syscall.Signal) error
- func WaitForProcStop(ctx context.Context, pid int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FlatChildTree ¶
FlatChildTree returns gopsutil Process instances of all descendants of a process with the specified PID `pid`.
The first element is deepest descendant. The last one is a progenitor or closest child.
If the `withRoot` argument is set to true, add root process to the end.
func KillWithContext ¶
KillWithContext kills process with PID `pid` using context `ctx`.
func SendMessage ¶
SendMessage is the same as SendMessageWithContext with background context.
func SendMessageWithContext ¶
SendMessageWithContext writes a `msg` message to the console process with PID `pid` using context `ctx`.
`msg` must end with "\n" on Linux and with "\r" on macOS to be sent.
Requires root privilegies (e.g. run as sudo).
func SendSigTerm ¶
SendSigTerm is the same as SendSigTermWithContext with background context.
func SendSigTermWithContext ¶
SendSigTermWithContext sends SIGTERM signal to the process with PID `pid` using context `ctx`.
func SendSignal ¶
SendSignal is the same as SendSignalWithContext with background context.
func SendSignalWithContext ¶
SendSignalWithContext sends signal `sig` to the process with PID `pid` using context `ctx`.
func WaitForProcStop ¶
WaitForProcStop returns when process with PID `pid` is no longer running or `ctx` deadline exceedes.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
posix/external_pid_sigint
command
|
|
|
posix/same_terminal
command
|
|
|
windows/external_pid_ctrlc
command
|
|
|
windows/process_group
command
|
|
|
windows/same_terminal
command
|
|
|
windows/tree
command
|
|
|
internal
|
|
|
proxy
command
|
|