Skip to content

pfSense with CrowdSec - Reboot Hang - Waiting for Crowdsec #115

@daygle

Description

@daygle

After installing CrowdSec on pfSense using:

fetch https://raw.githubusercontent.com/crowdsecurity/pfSense-pkg-crowdsec/refs/heads/main/install-crowdsec.sh
sh install-crowdsec.sh

I configured the service and attempted a reboot via the pfSense WebUI. The system hung indefinitely at:

Stopping package crowdsec...

This appears to be caused by the CrowdSec firewall bouncer retrying LAPI connections during shutdown, even after the LAPI has already terminated. The bouncer waits for a response that never arrives, and since pfSense (FreeBSD) does not enforce service timeouts or force-kill stalled processes, the reboot sequence stalls.

From crowdsec-firewall-bouncer.log:

level=error msg="auth-api: auth with api key failed return nil response, error: dial tcp 127.0.0.1:8088: connect: connection refused"
level=error msg="failed to connect to LAPI, retrying in 10s"
...
level=fatal msg="process terminated with error: received SIGTERM"

I previously encountered this exact issue on OPNsense, and I’m disappointed to see it persists on pfSense. The behavior is consistent across both platforms: GUI-triggered reboots hang, while shell-based reboot works because it bypasses graceful service shutdown.

CrowdSec and its bouncer should:

  • Exit cleanly on SIGTERM
  • Avoid retrying LAPI connections during shutdown
  • Respect FreeBSD’s service lifecycle without blocking reboots

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions