From 59d7d08aee12952da2350fcdff893391e9df8474 Mon Sep 17 00:00:00 2001 From: ziggie Date: Fri, 24 Mar 2023 16:07:16 +0100 Subject: [PATCH] loopd: nil-pointer bug when showing subsystems --- loopd/run.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/loopd/run.go b/loopd/run.go index 34b2cd70..9cc3ad1e 100644 --- a/loopd/run.go +++ b/loopd/run.go @@ -180,13 +180,6 @@ func Run(rpcCfg RPCConfig) error { os.Exit(0) } - // Special show command to list supported subsystems and exit. - if config.DebugLevel == "show" { - fmt.Printf("Supported subsystems: %v\n", - logWriter.SupportedSubsystems()) - os.Exit(0) - } - // Validate our config before we proceed. if err := Validate(&config); err != nil { return err @@ -205,6 +198,14 @@ func Run(rpcCfg RPCConfig) error { logWriter := build.NewRotatingLogWriter() SetupLoggers(logWriter, shutdownInterceptor) + // Special show command to list supported subsystems and exit. + if config.DebugLevel == "show" { + fmt.Printf("Supported subsystems: %v\n", + logWriter.SupportedSubsystems()) + + os.Exit(0) + } + err = logWriter.InitLogRotator( filepath.Join(config.LogDir, defaultLogFilename), config.MaxLogFileSize, config.MaxLogFiles,