Repository navigation
Declare the account once, and leave no log file the service cannot write - #3
Merged
marcos-mendez merged 1 commit intoSep 28, 2026
Merged
Conversation
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.conf published the administrative account as "user admin off",
the way keel-mariadb publishes an account with a password hash no input
produces, and firstboot.d/35redispass declared it again with its digest.
Redis refuses that outright:
Error in user declaration 'admin': Duplicate user found.
A user can only be defined once in config files
Measured on the booted appliance, where it left redis-server.service in a
restart loop and 35redispass failing 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 logfile setting is ever given, so the path in
the packaged configuration is created even though the check passes
--logfile pointing into its own scratch directory. The check runs as root:
redis-server[524]: *** FATAL CONFIG FILE ERROR (Redis 8.0.2) ***
redis-server[524]: Can't open the log file: Permission denied
/var/log/redis/redis-server.log, owned by root, in a directory owned by the
redis user, which is 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-nginx layer
installs redis-server too and its /var/log/redis is empty, and the forum
container built from it runs redis with a redis owned log. Nothing in the
package or the common tree does this. The check did.
Tests
-----
70 bats tests, three measured files at 100 percent each (129 lines). The
conf stub opens the packaged log file the way redis does, so the test would
have caught this; it did not before, because the stub was more polite than
the program.
marcos-mendez
deleted the
fix/one-user-declaration-and-no-log-left-behind
branch
September 28, 2026 02:28
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.
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