소스 검색

Reduce log verbosity at startup (#2363)

A configuration syntax test is performed every time the service is
started from systemd. The resulting error, if any, is shown on
journalctl logs.
This PR removes the unnecessary output in crowdsec.log generated by the
configuration test.
mmetc 2 년 전
부모
커밋
3c16139c44
2개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      cmd/crowdsec/serve.go
  2. 1 1
      config/crowdsec.service

+ 1 - 1
cmd/crowdsec/serve.go

@@ -344,7 +344,7 @@ func Serve(cConfig *csconfig.Config, apiReady chan bool, agentReady chan bool) e
 	}
 	}
 
 
 	if flags.TestMode {
 	if flags.TestMode {
-		log.Infof("test done")
+		log.Infof("Configuration test done")
 		pluginBroker.Kill()
 		pluginBroker.Kill()
 		os.Exit(0)
 		os.Exit(0)
 	}
 	}

+ 1 - 1
config/crowdsec.service

@@ -5,7 +5,7 @@ After=syslog.target network.target remote-fs.target nss-lookup.target
 [Service]
 [Service]
 Type=notify
 Type=notify
 Environment=LC_ALL=C LANG=C
 Environment=LC_ALL=C LANG=C
-ExecStartPre=/usr/local/bin/crowdsec -c /etc/crowdsec/config.yaml -t
+ExecStartPre=/usr/local/bin/crowdsec -c /etc/crowdsec/config.yaml -t -error
 ExecStart=/usr/local/bin/crowdsec -c /etc/crowdsec/config.yaml
 ExecStart=/usr/local/bin/crowdsec -c /etc/crowdsec/config.yaml
 #ExecStartPost=/bin/sleep 0.1
 #ExecStartPost=/bin/sleep 0.1
 ExecReload=/bin/kill -HUP $MAINPID
 ExecReload=/bin/kill -HUP $MAINPID