process_utils

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProcStateStopped = "NOT RUNNING"
	ProcStateDead    = "ERROR. The process is dead"
	ProcStateRunning = "RUNNING. PID: %v."
)

Variables

This section is empty.

Functions

func CheckPIDFile

func CheckPIDFile(pidFileName string) error

CheckPIDFile checks that the process PID file exists and is readable. Or process is already exist. Removes PID file if process is dead.

func CreatePIDFile

func CreatePIDFile(pidFileName string) error

CreatePIDFile checks that the instance PID file is absent or deprecated and creates a new one. Returns an error on failure.

func GetPIDFromFile

func GetPIDFromFile(pidFileName string) (int, error)

GetPIDFromFile returns PID from the PIDFile.

func IsProcessAlive

func IsProcessAlive(pid int) (bool, error)

IsProcessAlive checks if the process is alive.

func ProcessStatus

func ProcessStatus(pidFile string) string

ProcessStatus returns the status of the process.

func StopProcess

func StopProcess(pidFile string) (int, error)

StopProcess stops the process by pidFile.

Types

This section is empty.

Jump to

Keyboard shortcuts

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