Declare the account once, and leave no log file the service cannot write #3
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/unit-redis!3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/one-user-declaration-and-no-log-left-behind"
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?
Two defects, both found by booting the layer, and neither findable by the build: the build's own checks passed, because a build runs everything as root.
A user may be declared only once
20-keel-acl.confpublished the administrative account asuser admin off, the waykeel-mariadbpublishes an account with a password hash no input produces, andfirstboot.d/35redispassdeclared it again with its digest. Redis refuses that outright:Measured on the booted appliance, where it left
redis-server.servicein a restart loop and35redispassfailing with exit 1. The build time fragment names no administrative account now, and the first boot names it once. An account that is not declared cannot authenticate either, which is the property that mattered.A log file the service cannot write
Redis opens every value its
logfilesetting is ever given, so the path in the packaged configuration is created even though the check passes--logfilepointing into its own scratch directory. The check runs as root:/var/log/redis/redis-server.log, owned by root, in a directory owned by the redis user: a service that cannot start on any machine built from the layer. The package ships no such file and redis makes its own at its first start, as its own user, so the check removes an empty one and leaves one with anything in it alone.The comparison that settled whose defect it was: the
nodejs-nginxlayer installsredis-servertoo, its/var/log/redisis empty, and theforumcontainer built from it runs redis with a redis owned log. Nothing in the package or the common tree does this. The check did.The corrected design, proved on the booted machine before this was written
Coverage
70 bats tests, three measured files at 100 percent each, 129 lines. The
redis-serverstub intests/conf.batsopens the packaged log file the way redis does now: the test would have caught this, and did not before, because the stub was more polite than the program.Test plan
COVERAGE_THRESHOLD=100 tests/coverage.sh: 100/100/100 over 70 teststests / coveragegreen here