Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a hook on fatal/panic to ensure we're logging to stderr as well #879

Merged
merged 1 commit into from Aug 5, 2021

Conversation

buixor
Copy link
Contributor

@buixor buixor commented Aug 4, 2021

the goal of this MR is to ensure that when we're failing during startup, the fatal log will show in systemctl status crowdsec :

● crowdsec.service - Crowdsec agent
     Loaded: loaded (/etc/systemd/system/crowdsec.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Wed 2021-08-04 19:11:04 CEST; 9ms ago
    Process: 84006 ExecStartPre=/usr/local/bin/crowdsec -c /etc/crowdsec/config.yaml -t (code=exited, status=0/SUCCESS)
    Process: 84040 ExecStart=/usr/local/bin/crowdsec -c /etc/crowdsec/config.yaml (code=exited, status=1/FAILURE)
   Main PID: 84040 (code=exited, status=1/FAILURE)

Aug 04 19:11:03 zeroed systemd[1]: Starting Crowdsec agent...
Aug 04 19:11:04 zeroed crowdsec[84040]: time="04-08-2021 19:11:04" level=fatal msg="listen tcp 127.0.0.1:8080: bind: address already in use"
Aug 04 19:11:04 zeroed systemd[1]: crowdsec.service: Main process exited, code=exited, status=1/FAILURE
Aug 04 19:11:04 zeroed systemd[1]: crowdsec.service: Failed with result 'exit-code'.
Aug 04 19:11:04 zeroed systemd[1]: Failed to start Crowdsec agent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants