MCPcopy Create free account
hub / github.com/caddyserver/caddy / PIDFile

Function PIDFile

admin.go:1443–1451  ·  view source on GitHub ↗

PIDFile writes a pidfile to the file at filename. It will get deleted before the process gracefully exits.

(filename string)

Source from the content-addressed store, hash-verified

1441// PIDFile writes a pidfile to the file at filename. It
1442// will get deleted before the process gracefully exits.
1443func 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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…