Skip to content
This package provides structure and helper functions to create and remove PID file.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode
.editorconfig
.gitignore
.travis.yml
LICENSE
Makefile
README.md
go.mod
go.sum
pidfile.go
pidfile_linux.go
pidfile_test.go
pidfile_unix.go
pidfile_windows.go

README.md

A Tiny PIDFile Library for Golang

Build Status Go Report Card

This package provides structure and helper functions to create and remove PID file. PIDFile is a file used to store the process ID of a running process.

For more information and documents, visit https://godoc.org/github.com/mingcheng/pidfile.go

Feature

  • Support on muti-system (Linux, macOS, Windows and FreeBSD)
  • With all full tested

Usage

To usage this package is simple, here is an example:

import	"github.com/mingcheng/pidfile"

var pidFilePath = "/var/run/my.pid"
if pid, err := pidfile.New(pidFilePath); err != nil {
  log.Panic(err)
} else {
  fmt.Println(pid)
  defer pid.Remove()
}

Feedback

If you have any suggest, sending me via email to echo bWluZ2NoZW5nQG91dGxvb2suY29tCg== | base64 -D, with huge thanks.

- eof -

You can’t perform that action at this time.