Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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 -

About

This package provides structure and helper functions to create and remove PID file.

Resources

License

Packages

No packages published