commons

package
v0.12.10 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintVersion

func PrintVersion(command *cobra.Command) error

func ProcessCommonFlags

func ProcessCommonFlags(command *cobra.Command) (*commons.Config, error)

func ProcessRunning added in v0.12.0

func ProcessRunning(pid int) bool

ProcessRunning reports whether a process exists or cannot be inspected due to insufficient permission.

func ReadPID added in v0.12.0

func ReadPID(path string) (int, error)

ReadPID reads and validates a PID from a PID file.

func SetCommonFlags

func SetCommonFlags(command *cobra.Command)

func SignalPID added in v0.12.0

func SignalPID(pid int, signal syscall.Signal) error

SignalPID sends a signal to a process and reports stale PID files clearly.

Types

type PIDFile added in v0.12.0

type PIDFile struct {
	// contains filtered or unexported fields
}

PIDFile holds an exclusive lock on a process ID file.

func AcquirePIDFile added in v0.12.0

func AcquirePIDFile(path string) (*PIDFile, error)

AcquirePIDFile creates and exclusively locks a PID file for this process.

func (*PIDFile) Close added in v0.12.0

func (p *PIDFile) Close() error

Close removes the owned PID file and releases its lock.

Jump to

Keyboard shortcuts

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