pidfile

package
v0.0.0-...-f9d70ec Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrPid process id failed
	ErrPid = errors.New("process id error")

	// Debug whether to enable debug mode
	Debug bool

	// ErrServerAlreadyRun Service is already running
	ErrServerAlreadyRun = errors.New("server already running")

	// ErrPidExists pid already exists
	ErrPidExists = errors.New("pid file exists")

	// ErrLockFaild pid lock failed
	ErrLockFaild = errors.New("pid file lock faild")
)

Functions

func CheckExit

func CheckExit(filename string) (int, error)

CheckExit check if pid is running

func CheckLockFile

func CheckLockFile(fd uintptr) error

CheckLockFile check if the fd is locked

func Create

func Create(pidfile string) (int, error)

Create create pid file

func GetPID

func GetPID(pidfile string) (int, error)

GetPID get pid

func IsActive

func IsActive(pid int) (bool, error)

IsActive check if the pid process is alive

Types

This section is empty.

Jump to

Keyboard shortcuts

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