mirror of
https://github.com/GwynethLlewelyn/goswi.git
synced 2026-08-14 00:58:00 +00:00
29 lines
656 B
Go
29 lines
656 B
Go
//go:build !systemd
|
|
|
|
package main
|
|
|
|
import (
|
|
"os"
|
|
)
|
|
|
|
// talk to systemd, inform that we're reloading
|
|
func notify(notification notificationType) {
|
|
switch notification {
|
|
case appReloading:
|
|
config.LogTrace("(re)loading app configuration...")
|
|
case appReady:
|
|
config.LogTrace("app configuration loaded, system is now ready!")
|
|
case appStopping:
|
|
config.LogTrace("stopping app...")
|
|
case appStoppingError:
|
|
config.LogFatal("fatal system error, code 126")
|
|
os.Exit(126)
|
|
}
|
|
}
|
|
|
|
// Auxiliary function to communicate with the systemd daemon and spew out the appropriate messages.
|
|
func systemdNotify(state string) error {
|
|
config.LogInfo(state)
|
|
return nil
|
|
}
|