snapshot of https://github.com/centrifugal/centrifugo.git (master, 2026-09-16; blobs > 131072B omitted)
This commit is contained in:
14
internal/tools/pid.go
Normal file
14
internal/tools/pid.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package tools
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
func WritePidFile(pidFile string) error {
|
||||
if pidFile == "" {
|
||||
return nil
|
||||
}
|
||||
pid := []byte(strconv.Itoa(os.Getpid()) + "\n")
|
||||
return os.WriteFile(pidFile, pid, 0600)
|
||||
}
|
||||
Reference in New Issue
Block a user