clustvirt/daemon/control.go

19 lines
261 B
Go

package daemon
import (
"fmt"
"os"
"git.staur.ca/stobbsm/clustvirt/lib/log"
)
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)
}
}