Matthew Stobbs
1113062d9e
- lib/log is now git.staur.ca/stobbsm/simplelog - router is now git.staur.ca/stobbsm/simpleroute
19 lines
257 B
Go
19 lines
257 B
Go
package daemon
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
log "git.staur.ca/stobbsm/simplelog"
|
|
)
|
|
|
|
func Start() {
|
|
pid := pid()
|
|
if err := os.WriteFile(PIDFile, []byte(fmt.Sprint(pid)), 0666); err != nil {
|
|
log.Error("daemon.Start").
|
|
Err(err).
|
|
Send()
|
|
os.Exit(1)
|
|
}
|
|
}
|