feat: apply runs an overlay's state hooks (0041 step 7, #62) #63
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Keel-Linux/keel!63
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/overlay-state-hooks"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Item 1 of #62, needed by step 7 of handbook decision 0041 (Keel Web): keel converged only units, so turning
corazaon in the spec wrote Monit'swaf-blockscheck and loaded nothing.apply --systemnow runs an overlay's state hooks withenabledordisabled:/usr/lib/keel/overlays/<name>/state, which the overlay's package ships (keel-overlay-coraza has it since common#21);/usr/lib/keel/overlays/<name>/state.d/, in name order, plain names only as run-parts has it. keel-web usesanubis/state.d/to route its default site through Anubis while the overlay is enabled.They run after the overlay's units come up and before they go down. A hook cannot be asked for its state, so keel records it in
/var/lib/keel/overlays/<name>once every hook passed and runs them again only when the spec differs from the record (a second apply changes nothing; a new machine runs each hook once). A failed hook fails the step and records nothing. Nothing runs under--root. keel 0.15.0.Items 2 to 4 of #62 stay open (diff and inspect for a unitless overlay, the Anubis key's file, Monit's re-encoding).
Test plan
tests/test_system_overlay_hooks.py(16 tests, written first): order around the units, the record,--root,state.dordering and filtering;keel/system/hooks.py100 percent, full suite at 99 percentwaf-blocksandanubisAfter review (
a510b9f)hooks.state: {path, timeout}in the overlay manifest, validated (rule 12's checks; timeout 1 to 600 s, 120 by default); only a declared state hook runs. Handbook erratum: Keel-Linux/handbook#35.state.dare lstat'ed: root's, not group or world writable, links only inside/usr/lib/keel/overlays; otherwise the step is refused.--rootthe step says "not run" only.