Documentation ¶
Overview ¶
Package p1idpath is a helper for managing a PID file to denote when a process might already be running.
Index ¶
Constants ¶
const UnknownPID = -1
UnknownPID indicates the PID read from the file wasn't located as a running process.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PidPath ¶
type PidPath struct {
// contains filtered or unexported fields
}
PidPath is the type for managing a PID file.
func NewPidPath ¶
NewPidPath manages a process ID file to coordinate whether a process is already running.
func (*PidPath) Check ¶
Check will determine the state of the process. A `nil` returned indicates no other process was found active.
func (*PidPath) CheckAndSet ¶
CheckAndSet evaluates if the process is currently running and, if not, sets the current process ID into the file.
func (*PidPath) IsOurs ¶
IsOurs determines if the pidpath indicates that its process is the currently executing one (the caller) of this function.
func (*PidPath) IsRunning ¶
IsRunning determines if the pidpath indicates that its process is in the process listing (see Getpid's note).