Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rfyiamcool/go-fcntl-pid
golang fcntl pid
https://github.com/rfyiamcool/go-fcntl-pid
fcntl golang pid
Last synced: 2 months ago
JSON representation
golang fcntl pid
- Host: GitHub
- URL: https://github.com/rfyiamcool/go-fcntl-pid
- Owner: rfyiamcool
- Created: 2017-08-14T23:45:58.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-07-29T02:04:52.000Z (over 4 years ago)
- Last Synced: 2024-06-20T03:41:02.211Z (6 months ago)
- Topics: fcntl, golang, pid
- Language: Go
- Homepage: http://xiaorui.cc
- Size: 3.91 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# go-fcntl-pid
use syscall.flock() to write pid file, avoid concurrently start to cause bug concurrently .
## example:
```
package mainimport (
"fmt"
"time""github.com/rfyiamcool/go-fcntl-pid"
)func pp() {
for {
time.Sleep(1 * time.Second)
fmt.Println("trigger keepalive")
}
}func main() {
filename := "mm.pid"
pidfile.CheckExit(filename)
pp()
}
```