This commit is contained in:
Daniel
2024-11-12 13:30:47 +01:00
parent ddf7ba170e
commit 8b1bdc7eb1
9 changed files with 70 additions and 50 deletions

View File

@@ -24,6 +24,7 @@ import (
func init() {
// flag.BoolVar(&updates.RebootOnRestart, "reboot-on-restart", false, "reboot server on auto-upgrade")
// FIXME
}
var sigUSR1 = syscall.Signal(0xa)
@@ -48,6 +49,8 @@ func main() {
log.SetLogLevel(log.WarningLevel)
_ = log.Start()
// FIXME: Use service?
// Create instance.
var execCmdLine bool
instance, err := spn.New()
@@ -109,7 +112,7 @@ func main() {
slog.Warn("program was interrupted, stopping")
}
case <-instance.Stopped():
case <-instance.ShutdownComplete():
log.Shutdown()
os.Exit(instance.ExitCode())
}

View File

@@ -78,6 +78,8 @@ func main() {
}
instance.AddModule(observer)
// FIXME: Use service?
// Execute command line operation, if requested or available.
switch {
case !execCmdLine:
@@ -126,7 +128,7 @@ func main() {
slog.Warn("program was interrupted, stopping")
}
case <-instance.Stopped():
case <-instance.ShuttingDown():
log.Shutdown()
os.Exit(instance.ExitCode())
}

View File

@@ -58,7 +58,7 @@ func initializeGlobals(cmd *cobra.Command, args []string) {
svcCfg = &service.ServiceConfig{
BinDir: binDir,
DataDir: dataDir,
BinariesIndexURLs: service.DefaultBinaryIndexURLs,
BinariesIndexURLs: service.DefaultStableBinaryIndexURLs,
IntelIndexURLs: service.DefaultIntelIndexURLs,
VerifyBinaryUpdates: service.BinarySigningTrustStore,
VerifyIntelUpdates: service.BinarySigningTrustStore,