crowdsec icon indicating copy to clipboard operation
crowdsec copied to clipboard

deb postinst starts crowdsec without honoring policy-rc.d

Open AdzerKI opened this issue 1 week ago • 3 comments

What happened?

The deb postinst starts the agent with a plain systemctl start crowdsec, so it ignores /usr/sbin/policy-rc.d. We install crowdsec on fresh hosts with our acquisition files already in place, and acquis.d/appsec.yaml points to crowdsecurity/appsec-bot-* configs that we install from the hub right after the package. Our policy-rc.d holds the service during apt-get install, but the postinst starts it anyway, the agent exits with no installed appsec-config matches pattern "crowdsecurity/appsec-bot-*", and dpkg --configure fails.

What did you expect to happen?

The postinst honors policy-rc.d like other packages do through deb-systemd-invoke (or invoke-rc.d), as Debian Policy 9.3.3 asks.

How can we reproduce it?

  1. Add a policy-rc.d that returns 101 for crowdsec.
  2. apt-get install crowdsec.
  3. The service is started anyway.

Anything else we need to know?

deb-systemd-invoke comes from init-system-helpers, which is Essential on Debian and Ubuntu. Fix: https://github.com/AdzerKI/crowdsec/commit/9b9bfe62

Crowdsec version

$ cscli version
version: v1.8.2-debian-pragmatic-amd64

build/debian/postinst is the same on master.

OS version

Ubuntu 26.04

AdzerKI avatar Nov 23 '26 16:11 AdzerKI

@AdzerKI: Thanks for opening an issue, it is currently awaiting triage.

In the meantime, you can:

  1. Check Crowdsec Documentation to see if your issue can be self resolved.
  2. You can also join our Discord.
  3. Check Releases to make sure your agent is on the latest version.
Details

I am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository.

github-actions[bot] avatar Nov 23 '26 16:11 github-actions[bot]

@AdzerKI: There are no 'kind' label on this issue. You need a 'kind' label to start the triage process.

  • /kind feature
  • /kind enhancement
  • /kind refactoring
  • /kind bug
  • /kind packaging
Details

I am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository.

github-actions[bot] avatar Nov 23 '26 16:11 github-actions[bot]

/kind bug

AdzerKI avatar Nov 24 '26 09:11 AdzerKI