pidfile

package module
v0.0.0-...-25d5d2a Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

README

pidfile

pidfiles for golang

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrProcessRunning = errors.New("process is running")
	ErrFileStale      = errors.New("pidfile exists but process is not running")
	ErrFileInvalid    = errors.New("pidfile has invalid contents")
)

Functions

func Remove

func Remove(filename string) error

Remove a pidfile

func Write

func Write(filename string) (error, string)

Write writes a pidfile, returning an error if the process is already running or pidfile is orphaned 如果判断Old进程仍在运行,同时返回进程的可执行文件路径

func WriteControl

func WriteControl(filename string, pid int, overwrite bool) (error, string)

Write writes a pidfile, returning an error 如果判断Old进程仍在运行,同时返回进程的可执行文件路径

Types

This section is empty.

Jump to

Keyboard shortcuts

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