pidfile

package
v1.5.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clean

func Clean()

Clean cleans up everything created by this package.

func Kill

func Kill(pidfilePath string) error

Kill opens the pidfile at the specified path, attempts to read the PID and kill the process represented by that PID. If the file doesn't exist, the corresponding process doesn't exist, or the process is successfully killed, returns nil. Otherwise, returns an error indicating the failure to kill the process.

On success, deletes the pidfile from the filesystem. Otherwise, leaves it in place.

func Remove

func Remove(path string)

Remove deletes the pidfile at the specified path. This does not clean up the corresponding process, so should only be used when it is known that the PID contained in the file at the specified path is no longer running.

func Write

func Write(path string) error

Write the pid of the process to the specified path, and attach a cleanup handler to the exit of the program so it's removed afterwards.

Types

This section is empty.

Jump to

Keyboard shortcuts

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