PIDFile writes a pidfile to the file at filename. It will get deleted before the process gracefully exits.
(filename string)
| 1441 | // PIDFile writes a pidfile to the file at filename. It |
| 1442 | // will get deleted before the process gracefully exits. |
| 1443 | func PIDFile(filename string) error { |
| 1444 | pid := []byte(strconv.Itoa(os.Getpid()) + "\n") |
| 1445 | err := os.WriteFile(filename, pid, 0o600) |
| 1446 | if err != nil { |
| 1447 | return err |
| 1448 | } |
| 1449 | pidfile = filename |
| 1450 | return nil |
| 1451 | } |
| 1452 | |
| 1453 | // idRegexp is used to match ID fields and their associated values |
| 1454 | // in the config. It also matches adjacent commas so that syntax |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…