pidfile

package
v0.5.0-devel Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: Apache-2.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPath

func GetPath() string

GetPath returns the current pidfile path.

func OwnerPid

func OwnerPid() (int, error)

OwnerPid returns the ID of the process owning the PID file. 0 is returned if it is known that no process owns the file. -1 and an error is returned if the owner or its existence could not be determined.

func Read

func Read() (int, error)

Read reads the content of the PID file. It returns the process ID found in the file. If opening the file or reading an integer process ID fails Read() returns -1 and an error.

func Remove

func Remove() error

Remove removes the PID file for the process unconditionally, regardless if the current process had created the PID file or not.

func SetPath

func SetPath(path string)

SetPath sets the pidfile path to the given one.

func Write

func Write() error

Write opens the PID file and writes os.Getpid() to it. If the PID file already exists Write() fails with an error. On successful completion, Write keeps the PID file open.

Types

This section is empty.

Jump to

Keyboard shortcuts

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