Repository navigation
fix: load packages whose run hook is a run file in the package root - #103
Merged
Merged
Conversation
run_command decided whether to `hab svc load` by testing for `hooks/run` inside the installed package. The supervisor accepts a run hook in either of two places: `hooks/run`, written from a hook template, or a `run` file in the package root, which is what `pkg_svc_run` in a plan produces. Packages built the second way -- core/redis is one, and it is the example in our own README -- were installed by the converge and then silently never loaded. `hab svc status` said "No services loaded" and Test Kitchen reported the converge as a success, because the whole `hab svc load` branch was skipped rather than failing. Both platform paths now resolve the package path once and check both locations, and the Windows path also checks the .ps1 form of each. Found by the integration suites added in #99, which is what the default and user-toml suites are currently failing on. Signed-off-by: Tim Smith <tim@mondoo.com>
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.
The integration suites from #99 went green on
library-packageand red ondefaultanduser-toml, both of which loadcore/redis. The converge exited 0, and then the verifier found this:hab pkg install core/redishad succeeded a fraction of a second earlier. The load was never attempted.Why
run_commandgates the load on this:The supervisor accepts a run hook in either of two places —
hooks/run, written from a hook template, or arunfile in the package root, which is whatpkg_svc_runin a plan produces. We only ever checked the first.core/redisis built the second way:So for every package written that way — and
pkg_svc_runis the older, simpler, still very common style, including thecore/redisexample in our own README — the provisioner installed the package, skipped the entire load branch, and reported success. No error, no warning, nothing in the output to suggest the service you asked for was never started.The fix
Both platform paths now resolve the package path once and check both locations:
The Windows side also checks the
.ps1form of each, which is how a Windows plan spells the same two hooks.library-package(core/jq-static, no run hook of either kind) keeps passing, so the negative branch is still covered — a library or build-time dependency still converges without a service being started.Verification
The real check is this PR's own
defaultanduser-tomlintegration jobs, which should now go green.