From 3c16139c44002510c8ce996164b0f1e32f15d465 Mon Sep 17 00:00:00 2001 From: mmetc <92726601+mmetc@users.noreply.github.com> Date: Wed, 19 Jul 2023 13:28:52 +0200 Subject: [PATCH] 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. --- cmd/crowdsec/serve.go | 2 +- config/crowdsec.service | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/crowdsec/serve.go b/cmd/crowdsec/serve.go index 5d365b410d7..2efb14613fb 100644 --- a/cmd/crowdsec/serve.go +++ b/cmd/crowdsec/serve.go @@ -344,7 +344,7 @@ func Serve(cConfig *csconfig.Config, apiReady chan bool, agentReady chan bool) e } if flags.TestMode { - log.Infof("test done") + log.Infof("Configuration test done") pluginBroker.Kill() os.Exit(0) } diff --git a/config/crowdsec.service b/config/crowdsec.service index 0897e1b5091..147cae4946e 100644 --- a/config/crowdsec.service +++ b/config/crowdsec.service @@ -5,7 +5,7 @@ After=syslog.target network.target remote-fs.target nss-lookup.target [Service] Type=notify 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 #ExecStartPost=/bin/sleep 0.1 ExecReload=/bin/kill -HUP $MAINPID