Skip to content

facts.server.SecurityLimits: handle missing limits.conf#1582

Open
wowi42 wants to merge 1 commit intopyinfra-dev:3.xfrom
KalvadTech:fix/security-limits-missing-file
Open

facts.server.SecurityLimits: handle missing limits.conf#1582
wowi42 wants to merge 1 commit intopyinfra-dev:3.xfrom
KalvadTech:fix/security-limits-missing-file

Conversation

@wowi42
Copy link
Contributor

@wowi42 wowi42 commented Mar 5, 2026

When /etc/security/limits.conf does not exist (e.g. on Alpine/minimal systems), cat fails and pyinfra errors instead of returning the default empty list. Suppress stderr and force exit 0 so a missing file is treated as no limits configured.

  • Pull request is based on the default branch (3.x at this time)
  • Pull request includes tests for any new/updated operations/facts
  • Pull request includes documentation for any new/updated operations/facts
  • Tests pass (see scripts/dev-test.sh)
  • Type checking & code style passes (see scripts/dev-lint.sh)

When `/etc/security/limits.conf` does not exist (e.g. on Alpine/minimal
systems), `cat` fails and pyinfra errors instead of returning the
default empty list. Suppress stderr and force exit 0 so a missing file
is treated as no limits configured.
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.

1 participant