Repository navigation
fix: start monit after the units of Core's processes (keel#61) - #21
Merged
Merged
Conversation
A systemd drop-in in the keel-core package orders monit.service after ssh, webmin and postfix, ordering only. Started beside them, monit's first cycle after a boot found webmin and postfix inactive (Keel-Linux/keel#61, item 2). package.bats checks the drop-in matches the manifest's units; keel-core 0.1.1.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Item 2 of Keel-Linux/keel#61: in monit's first cycle after a boot, webmin and postfix showed as inactive.
Root cause: monit.service started alongside the units it checks. Monit's Core checks are the units of the manifest's processes (
systemctl is-active ssh/webmin/postfix), so its first check could run before those units had finished starting.Fix: the keel-core package (0.1.1) ships
/usr/lib/systemd/system/monit.service.d/keel-core.confwithAfter=ssh.service webmin.service postfix.service. This only orders startup: a unit that fails does not keep monit from starting, and monit then reports it. I did not use keel'sset daemon ... with start delayinstead, because that line is global and keel leaves the operator's cycle alone (decision 0021).Tests written first (
tests/package.bats):After=list equals the manifest's units;systemd-analyze verifyaccepts it.lintian is clean.
tests/README.mdno longer says that inspect loses the monitor channels (fixed by keel 0.15.1, Keel-Linux/keel#64).Real test: an LXC container from the step 7b Core image with this package installed.
systemctl show monit -p Afterlists the three units. After a reboot,systemd-analyze critical-chain monit.serviceshows monit after postfix, the firstmonit summaryshowed keel-unit-sshd/webmin/postfix and their probes all OK, and monit.log had no failures. The container was destroyed afterwards.This PR does not touch #19 (the console art): different files, and #19's recipe changelog entry is (4). Only
packages/keel-core/debian/changelogchanges here.Refs Keel-Linux/keel#61