diff --git a/dapps/valuetransfers/dapp.go b/dapps/valuetransfers/dapp.go index 6aaf256bede9688549cd77aeb593c31f9b4b0027..aa2443049896c0dcb53e837dfd901fbd3e6e9d20 100644 --- a/dapps/valuetransfers/dapp.go +++ b/dapps/valuetransfers/dapp.go @@ -99,10 +99,12 @@ func configure(_ *node.Plugin) { } func run(*node.Plugin) { - _ = daemon.BackgroundWorker("Tangle", func(shutdownSignal <-chan struct{}) { + if err := daemon.BackgroundWorker("Tangle", func(shutdownSignal <-chan struct{}) { <-shutdownSignal Tangle.Shutdown() - }, shutdown.PriorityTangle) + }, shutdown.PriorityTangle); err != nil { + log.Panicf("Failed to start as daemon: %s", err) + } runFPC() } diff --git a/dapps/valuetransfers/fpc.go b/dapps/valuetransfers/fpc.go index d8daf02a96c3f813297a843f7343043a5ec9c261..dbbaa8d391975fd3fd681f2b10f02bb8f9aea8f1 100644 --- a/dapps/valuetransfers/fpc.go +++ b/dapps/valuetransfers/fpc.go @@ -99,7 +99,7 @@ func configureFPC() { } func runFPC() { - daemon.BackgroundWorker("FPCVoterServer", func(shutdownSignal <-chan struct{}) { + if err := daemon.BackgroundWorker("FPCVoterServer", func(shutdownSignal <-chan struct{}) { voterServer = votenet.New(Voter(), func(id string) vote.Opinion { branchID, err := branchmanager.BranchIDFromBase58(id) if err != nil { @@ -133,9 +133,11 @@ func runFPC() { <-shutdownSignal voterServer.Shutdown() log.Info("Stopped vote server") - }, shutdown.PriorityFPC) + }, shutdown.PriorityFPC); err != nil { + log.Panicf("Failed to start as daemon: %s", err) + } - daemon.BackgroundWorker("FPCRoundsInitiator", func(shutdownSignal <-chan struct{}) { + if err := daemon.BackgroundWorker("FPCRoundsInitiator", func(shutdownSignal <-chan struct{}) { log.Infof("Started FPC round initiator") unixTsPRNG := prng.NewUnixTimestampPRNG(roundIntervalSeconds) defer unixTsPRNG.Stop() @@ -151,7 +153,9 @@ func runFPC() { } } log.Infof("Stopped FPC round initiator") - }, shutdown.PriorityFPC) + }, shutdown.PriorityFPC); err != nil { + log.Panicf("Failed to start as daemon: %s", err) + } } // PeerOpinionGiver implements the OpinionGiver interface based on a peer. diff --git a/plugins/analysis/client/plugin.go b/plugins/analysis/client/plugin.go index e434a4627b61ba85fc847a92fca10242f00dfe65..9e975f735b76f32742a4244c36719aa2fe0587fb 100644 --- a/plugins/analysis/client/plugin.go +++ b/plugins/analysis/client/plugin.go @@ -61,7 +61,7 @@ func run(_ *node.Plugin) { } } }, shutdown.PriorityAnalysis); err != nil { - log.Panic(err) + log.Panicf("Failed to start as daemon: %s", err) } } diff --git a/plugins/analysis/dashboard/autopeering_feed.go b/plugins/analysis/dashboard/autopeering_feed.go index acab58b3cd4d2685e99cfa1b350b1ad83cba7b3c..431061f4c9d8bacc736a32d25fd1cc7c2a2f9584 100644 --- a/plugins/analysis/dashboard/autopeering_feed.go +++ b/plugins/analysis/dashboard/autopeering_feed.go @@ -119,7 +119,7 @@ func runAutopeeringFeed() { autopeeringWorkerPool.Stop() log.Info("Stopping Analysis-Dashboard[AutopeeringVisualizer] ... done") }, shutdown.PriorityDashboard); err != nil { - panic(err) + log.Panicf("Failed to start as daemon: %s", err) } } diff --git a/plugins/analysis/dashboard/fpc_livefeed.go b/plugins/analysis/dashboard/fpc_livefeed.go index d1508f090bce076297d0b2b90f8e8f0880f27bb7..2c4e58bbacaef9b13019f1e1cf05132943932ef9 100644 --- a/plugins/analysis/dashboard/fpc_livefeed.go +++ b/plugins/analysis/dashboard/fpc_livefeed.go @@ -67,7 +67,7 @@ func runFPCLiveFeed() { analysis.Events.FPCHeartbeat.Detach(onFPCHeartbeatReceived) log.Info("Stopping Analysis[FPCUpdater] ... done") }, shutdown.PriorityDashboard); err != nil { - panic(err) + log.Panicf("Failed to start as daemon: %s", err) } } diff --git a/plugins/analysis/dashboard/plugin.go b/plugins/analysis/dashboard/plugin.go index 99e1b7ae514c2b23c6961af2eeb302de7881bb99..0d3817b561b24ffc0ecbc05f99bdcaab8c29fb3d 100644 --- a/plugins/analysis/dashboard/plugin.go +++ b/plugins/analysis/dashboard/plugin.go @@ -63,7 +63,7 @@ func run(*node.Plugin) { log.Infof("Starting %s ...", PluginName) if err := daemon.BackgroundWorker(PluginName, worker, shutdown.PriorityAnalysis); err != nil { - log.Errorf("Error starting as daemon: %s", err) + log.Panicf("Error starting as daemon: %s", err) } } diff --git a/plugins/analysis/dashboard/recorded_events.go b/plugins/analysis/dashboard/recorded_events.go index 018f839b7e0e841f401cc827e622f4b7feb55618..d0174bc7b456469bbb84529fa38c341d8462d239 100644 --- a/plugins/analysis/dashboard/recorded_events.go +++ b/plugins/analysis/dashboard/recorded_events.go @@ -110,7 +110,7 @@ func configureEventsRecording() { // starts record manager that initiates a record cleanup periodically func runEventsRecordManager() { - _ = daemon.BackgroundWorker("Dashboard Analysis Server Record Manager", func(shutdownSignal <-chan struct{}) { + if err := daemon.BackgroundWorker("Dashboard Analysis Server Record Manager", func(shutdownSignal <-chan struct{}) { ticker := time.NewTicker(cleanUpPeriod) defer ticker.Stop() for { @@ -121,7 +121,9 @@ func runEventsRecordManager() { cleanUp(cleanUpPeriod) } } - }, shutdown.PriorityAnalysis) + }, shutdown.PriorityAnalysis); err != nil { + log.Panicf("Failed to start as daemon: %s", err) + } } // removes nodes and links we haven't seen for at least 3 times the heartbeat interval. diff --git a/plugins/analysis/server/plugin.go b/plugins/analysis/server/plugin.go index ce93828929eb2b72932a037e68a281b2145d246c..d874e300645170b17987ebdeb1ff6c1d3e722980 100644 --- a/plugins/analysis/server/plugin.go +++ b/plugins/analysis/server/plugin.go @@ -69,7 +69,7 @@ func run(_ *node.Plugin) { log.Info("Stopping Server ...") server.Shutdown() }, shutdown.PriorityAnalysis); err != nil { - log.Panic(err) + log.Panicf("Failed to start as daemon: %s", err) } } diff --git a/plugins/autopeering/plugin.go b/plugins/autopeering/plugin.go index f9884bb4aec8400b4bd8d2c755da1251309b9a4c..74aa171c2a368f5247a0224b61a548fce2daead6 100644 --- a/plugins/autopeering/plugin.go +++ b/plugins/autopeering/plugin.go @@ -30,7 +30,7 @@ func configure(*node.Plugin) { func run(*node.Plugin) { if err := daemon.BackgroundWorker(PluginName, start, shutdown.PriorityAutopeering); err != nil { - log.Errorf("Failed to start as daemon: %s", err) + log.Panicf("Failed to start as daemon: %s", err) } } diff --git a/plugins/bootstrap/plugin.go b/plugins/bootstrap/plugin.go index d6ce2e3108c2e91689eba57e094ec9d843e7d960..1ebfd520865183b45508c6c2dca6d009618a433a 100644 --- a/plugins/bootstrap/plugin.go +++ b/plugins/bootstrap/plugin.go @@ -51,7 +51,7 @@ func run(_ *node.Plugin) { issuancePeriod := time.Duration(issuancePeriodSec) * time.Second // issue messages on top of the genesis - _ = daemon.BackgroundWorker("Bootstrapping-Issuer", func(shutdownSignal <-chan struct{}) { + if err := daemon.BackgroundWorker("Bootstrapping-Issuer", func(shutdownSignal <-chan struct{}) { messageSpammer.Start(initialIssuanceMPS) defer messageSpammer.Shutdown() // don't stop issuing messages if in continuous mode @@ -65,5 +65,7 @@ func run(_ *node.Plugin) { case <-time.After(issuancePeriod): case <-shutdownSignal: } - }, shutdown.PriorityBootstrap) + }, shutdown.PriorityBootstrap); err != nil { + log.Panicf("Failed to start as daemon: %s", err) + } } diff --git a/plugins/dashboard/drng_livefeed.go b/plugins/dashboard/drng_livefeed.go index 9bd474abc83fc0d2ca8c9c040fa7f9801f9dbd8f..01d468efb7ba9958c7ba31f5729f37a6aa46d942 100644 --- a/plugins/dashboard/drng_livefeed.go +++ b/plugins/dashboard/drng_livefeed.go @@ -40,7 +40,7 @@ func configureDrngLiveFeed() { } func runDrngLiveFeed() { - daemon.BackgroundWorker("Dashboard[DRNGUpdater]", func(shutdownSignal <-chan struct{}) { + if err := daemon.BackgroundWorker("Dashboard[DRNGUpdater]", func(shutdownSignal <-chan struct{}) { newMsgRateLimiter := time.NewTicker(time.Second / 10) defer newMsgRateLimiter.Stop() @@ -60,5 +60,7 @@ func runDrngLiveFeed() { log.Info("Stopping Dashboard[DRNGUpdater] ...") drng.Instance().Events.Randomness.Detach(notifyNewRandomness) log.Info("Stopping Dashboard[DRNGUpdater] ... done") - }, shutdown.PriorityDashboard) + }, shutdown.PriorityDashboard); err != nil { + log.Panicf("Failed to start as daemon: %s", err) + } } diff --git a/plugins/dashboard/livefeed.go b/plugins/dashboard/livefeed.go index 86841695ce9b14dd9ba68146f53ebb76eefd6ced..f0bebaa62488444d0dfb6025759fa548cf695ed6 100644 --- a/plugins/dashboard/livefeed.go +++ b/plugins/dashboard/livefeed.go @@ -39,7 +39,7 @@ func runLiveFeed() { } }) - daemon.BackgroundWorker("Dashboard[MsgUpdater]", func(shutdownSignal <-chan struct{}) { + if err := daemon.BackgroundWorker("Dashboard[MsgUpdater]", func(shutdownSignal <-chan struct{}) { messagelayer.Tangle.Events.MessageAttached.Attach(notifyNewMsg) liveFeedWorkerPool.Start() <-shutdownSignal @@ -48,5 +48,7 @@ func runLiveFeed() { newMsgRateLimiter.Stop() liveFeedWorkerPool.Stop() log.Info("Stopping Dashboard[MsgUpdater] ... done") - }, shutdown.PriorityDashboard) + }, shutdown.PriorityDashboard); err != nil { + log.Panicf("Failed to start as daemon: %s", err) + } } diff --git a/plugins/dashboard/plugin.go b/plugins/dashboard/plugin.go index dbed863790c3045af1514073eab934a25e72b578..f0f033aa705e2526f2521dff1fa4bb632ca472bc 100644 --- a/plugins/dashboard/plugin.go +++ b/plugins/dashboard/plugin.go @@ -81,7 +81,7 @@ func run(*node.Plugin) { log.Infof("Starting %s ...", PluginName) if err := daemon.BackgroundWorker(PluginName, worker, shutdown.PriorityAnalysis); err != nil { - log.Errorf("Error starting as daemon: %s", err) + log.Panicf("Error starting as daemon: %s", err) } } diff --git a/plugins/dashboard/visualizer.go b/plugins/dashboard/visualizer.go index 1e65a582ebdf3bdd0e8d3978695a77a25e9716ef..2725f40dcf2a997a3ee7f44d9f1bd206e345a1b7 100644 --- a/plugins/dashboard/visualizer.go +++ b/plugins/dashboard/visualizer.go @@ -79,7 +79,7 @@ func runVisualizer() { visualizerWorkerPool.TrySubmit(messageId, false) }) - daemon.BackgroundWorker("Dashboard[Visualizer]", func(shutdownSignal <-chan struct{}) { + if err := daemon.BackgroundWorker("Dashboard[Visualizer]", func(shutdownSignal <-chan struct{}) { messagelayer.Tangle.Events.MessageAttached.Attach(notifyNewMsg) defer messagelayer.Tangle.Events.MessageAttached.Detach(notifyNewMsg) messagelayer.Tangle.Events.MessageSolid.Attach(notifyNewMsg) @@ -93,5 +93,7 @@ func runVisualizer() { log.Info("Stopping Dashboard[Visualizer] ...") visualizerWorkerPool.Stop() log.Info("Stopping Dashboard[Visualizer] ... done") - }, shutdown.PriorityDashboard) + }, shutdown.PriorityDashboard); err != nil { + log.Panicf("Failed to start as daemon: %s", err) + } } diff --git a/plugins/dashboard/ws.go b/plugins/dashboard/ws.go index e8137d490b1cd731b3a3af72438cf25b061b3822..7092edfcb4b7ecd60069b548422219109e4c8b48 100644 --- a/plugins/dashboard/ws.go +++ b/plugins/dashboard/ws.go @@ -58,7 +58,7 @@ func runWebSocketStreams() { wsSendWorkerPool.TrySubmit(mps) }) - daemon.BackgroundWorker("Dashboard[StatusUpdate]", func(shutdownSignal <-chan struct{}) { + if err := daemon.BackgroundWorker("Dashboard[StatusUpdate]", func(shutdownSignal <-chan struct{}) { metrics.Events.ReceivedMPSUpdated.Attach(updateStatus) wsSendWorkerPool.Start() <-shutdownSignal @@ -66,7 +66,9 @@ func runWebSocketStreams() { metrics.Events.ReceivedMPSUpdated.Detach(updateStatus) wsSendWorkerPool.Stop() log.Info("Stopping Dashboard[StatusUpdate] ... done") - }, shutdown.PriorityDashboard) + }, shutdown.PriorityDashboard); err != nil { + log.Panicf("Failed to start as daemon: %s", err) + } } // reigsters and creates a new websocket client. diff --git a/plugins/database/plugin.go b/plugins/database/plugin.go index 99333abfe3b079adef2ac60109b9310457dcdbd9..5035199e453da8dada28cf0a2ea490d9f29708b3 100644 --- a/plugins/database/plugin.go +++ b/plugins/database/plugin.go @@ -79,7 +79,7 @@ func configure(_ *node.Plugin) { func run(_ *node.Plugin) { if err := daemon.BackgroundWorker(PluginName+"[GC]", runGC, shutdown.PriorityBadgerGarbageCollection); err != nil { - log.Errorf("Failed to start as daemon: %s", err) + log.Panicf("Failed to start as daemon: %s", err) } } diff --git a/plugins/gossip/plugin.go b/plugins/gossip/plugin.go index 07f4bc6ae125f1e2a280fe132e78d58bc2237e03..e7b953a9af83e965e156b004dd4d486e9596675c 100644 --- a/plugins/gossip/plugin.go +++ b/plugins/gossip/plugin.go @@ -35,7 +35,7 @@ func configure(*node.Plugin) { func run(*node.Plugin) { if err := daemon.BackgroundWorker(PluginName, start, shutdown.PriorityGossip); err != nil { - log.Errorf("Failed to start as daemon: %s", err) + log.Panicf("Failed to start as daemon: %s", err) } } diff --git a/plugins/messagelayer/plugin.go b/plugins/messagelayer/plugin.go index e5088a8679debcd80f68d182752d2083dc6b276a..5e7cd7d83db0699cfccdd144c5bd7f20d80939ba 100644 --- a/plugins/messagelayer/plugin.go +++ b/plugins/messagelayer/plugin.go @@ -73,15 +73,19 @@ func configure(*node.Plugin) { } func run(*node.Plugin) { - _ = daemon.BackgroundWorker("Tangle[MissingMessagesMonitor]", func(shutdownSignal <-chan struct{}) { + if err := daemon.BackgroundWorker("Tangle[MissingMessagesMonitor]", func(shutdownSignal <-chan struct{}) { Tangle.MonitorMissingMessages(shutdownSignal) - }, shutdown.PriorityMissingMessagesMonitoring) + }, shutdown.PriorityMissingMessagesMonitoring); err != nil { + log.Panicf("Failed to start as daemon: %s", err) + } - _ = daemon.BackgroundWorker("Tangle", func(shutdownSignal <-chan struct{}) { + if err := daemon.BackgroundWorker("Tangle", func(shutdownSignal <-chan struct{}) { <-shutdownSignal MessageFactory.Shutdown() MessageParser.Shutdown() Tangle.Shutdown() - }, shutdown.PriorityTangle) + }, shutdown.PriorityTangle); err != nil { + log.Panicf("Failed to start as daemon: %s", err) + } } diff --git a/plugins/metrics/plugin.go b/plugins/metrics/plugin.go index 10d52add3d897c82d8a3673811710cb2d31cce1e..7d62f84c8e0f189cd309a3faf538165d88182442 100644 --- a/plugins/metrics/plugin.go +++ b/plugins/metrics/plugin.go @@ -3,15 +3,15 @@ package metrics import ( "time" - "github.com/iotaledger/hive.go/daemon" - "github.com/iotaledger/hive.go/events" - "github.com/iotaledger/hive.go/node" - "github.com/iotaledger/hive.go/timeutil" - "github.com/iotaledger/goshimmer/packages/binary/messagelayer/message" "github.com/iotaledger/goshimmer/packages/binary/messagelayer/tangle" "github.com/iotaledger/goshimmer/packages/shutdown" "github.com/iotaledger/goshimmer/plugins/messagelayer" + "github.com/iotaledger/hive.go/daemon" + "github.com/iotaledger/hive.go/events" + "github.com/iotaledger/hive.go/logger" + "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/timeutil" ) // PluginName is the name of the metrics plugin. @@ -20,7 +20,10 @@ const PluginName = "Metrics" // Plugin is the plugin instance of the metrics plugin. var Plugin = node.NewPlugin(PluginName, node.Enabled, configure, run) +var log *logger.Logger + func configure(_ *node.Plugin) { + log = logger.NewLogger(PluginName) // increase received MPS counter whenever we attached a message messagelayer.Tangle.Events.MessageAttached.Attach(events.NewClosure(func(cachedMessage *message.CachedMessage, cachedMessageMetadata *tangle.CachedMessageMetadata) { cachedMessage.Release() @@ -31,7 +34,9 @@ func configure(_ *node.Plugin) { func run(_ *node.Plugin) { // create a background worker that "measures" the MPS value every second - daemon.BackgroundWorker("Metrics MPS Updater", func(shutdownSignal <-chan struct{}) { + if err := daemon.BackgroundWorker("Metrics MPS Updater", func(shutdownSignal <-chan struct{}) { timeutil.Ticker(measureReceivedMPS, 1*time.Second, shutdownSignal) - }, shutdown.PriorityMetrics) + }, shutdown.PriorityMetrics); err != nil { + log.Panicf("Failed to start as daemon: %s", err) + } } diff --git a/plugins/remotelog/plugin.go b/plugins/remotelog/plugin.go index cd895c089183b12e4fe0e2a6dd75e1d1f803254d..fadc136e1a0f1f4ee86861822da1b4e39adcccf2 100644 --- a/plugins/remotelog/plugin.go +++ b/plugins/remotelog/plugin.go @@ -95,7 +95,7 @@ func run(plugin *node.Plugin) { workerPool.TrySubmit(level, name, msg) }) - daemon.BackgroundWorker(PluginName, func(shutdownSignal <-chan struct{}) { + if err := daemon.BackgroundWorker(PluginName, func(shutdownSignal <-chan struct{}) { logger.Events.AnyMsg.Attach(logEvent) workerPool.Start() <-shutdownSignal @@ -103,7 +103,9 @@ func run(plugin *node.Plugin) { logger.Events.AnyMsg.Detach(logEvent) workerPool.Stop() log.Infof("Stopping %s ... done", PluginName) - }, shutdown.PriorityRemoteLog) + }, shutdown.PriorityRemoteLog); err != nil { + log.Panicf("Failed to start as daemon: %s", err) + } } func sendLogMsg(level logger.Level, name string, msg string) { diff --git a/plugins/sync/plugin.go b/plugins/sync/plugin.go index 29e2b79923ecbf9dc13b31e87a1a34157831f708..83b2e526d038d7e634f94e6f8a4a0deeb5f1abd2 100644 --- a/plugins/sync/plugin.go +++ b/plugins/sync/plugin.go @@ -130,7 +130,7 @@ func monitorForDesynchronization() { } }) - daemon.BackgroundWorker("Desync-Monitor", func(shutdownSignal <-chan struct{}) { + if err := daemon.BackgroundWorker("Desync-Monitor", func(shutdownSignal <-chan struct{}) { gossip.Manager().Events().NeighborRemoved.Attach(monitorPeerCountClosure) defer gossip.Manager().Events().NeighborRemoved.Detach(monitorPeerCountClosure) messagelayer.Tangle.Events.MessageAttached.Attach(monitorMessageInflowClosure) @@ -163,7 +163,9 @@ func monitorForDesynchronization() { return } } - }, shutdown.PrioritySynchronization) + }, shutdown.PrioritySynchronization); err != nil { + log.Panicf("Failed to start as daemon: %s", err) + } } // starts a background worker and event handlers to check whether the node is synchronized by first collecting @@ -200,7 +202,7 @@ func monitorForSynchronization() { synced <- types.Empty{} }) - daemon.BackgroundWorker("Sync-Monitor", func(shutdownSignal <-chan struct{}) { + if err := daemon.BackgroundWorker("Sync-Monitor", func(shutdownSignal <-chan struct{}) { messagelayer.Tangle.Events.MessageAttached.Attach(initAnchorPointClosure) defer messagelayer.Tangle.Events.MessageAttached.Detach(initAnchorPointClosure) messagelayer.Tangle.Events.MessageSolid.Attach(checkAnchorPointSolidityClosure) @@ -228,7 +230,9 @@ func monitorForSynchronization() { return } } - }, shutdown.PrioritySynchronization) + }, shutdown.PrioritySynchronization); err != nil { + log.Panicf("Failed to start as daemon: %s", err) + } } // fills up the anchor points with newly attached messages which then are used to determine whether we are synchronized. diff --git a/plugins/webapi/plugin.go b/plugins/webapi/plugin.go index 2f1a669e36daead1baf21ba37739bca3d2226d52..f97f3db9b9978caa4726aaeea60ad034921cab85 100644 --- a/plugins/webapi/plugin.go +++ b/plugins/webapi/plugin.go @@ -37,7 +37,7 @@ func configure(*node.Plugin) { func run(*node.Plugin) { log.Infof("Starting %s ...", PluginName) if err := daemon.BackgroundWorker("WebAPI Server", worker, shutdown.PriorityWebAPI); err != nil { - log.Errorf("Error starting as daemon: %s", err) + log.Panicf("Failed to start as daemon: %s", err) } } diff --git a/plugins/webapi/spammer/plugin.go b/plugins/webapi/spammer/plugin.go index e1dda8b4ad687f402a37b4b205ead151d1675443..f4de8c78a287796a5b01eaad065b119af72e6dc9 100644 --- a/plugins/webapi/spammer/plugin.go +++ b/plugins/webapi/spammer/plugin.go @@ -6,6 +6,7 @@ import ( "github.com/iotaledger/goshimmer/plugins/issuer" "github.com/iotaledger/goshimmer/plugins/webapi" "github.com/iotaledger/hive.go/daemon" + "github.com/iotaledger/hive.go/logger" "github.com/iotaledger/hive.go/node" ) @@ -17,15 +18,20 @@ const PluginName = "Spammer" // Plugin is the plugin instance of the spammer plugin. var Plugin = node.NewPlugin(PluginName, node.Disabled, configure, run) +var log *logger.Logger + func configure(plugin *node.Plugin) { + log = logger.NewLogger(PluginName) messageSpammer = spammer.New(issuer.IssuePayload) webapi.Server.GET("spammer", handleRequest) } func run(*node.Plugin) { - _ = daemon.BackgroundWorker("Tangle", func(shutdownSignal <-chan struct{}) { + if err := daemon.BackgroundWorker("Tangle", func(shutdownSignal <-chan struct{}) { <-shutdownSignal messageSpammer.Shutdown() - }, shutdown.PrioritySpammer) + }, shutdown.PrioritySpammer); err != nil { + log.Panicf("Failed to start as daemon: %s", err) + } }