Fix entrypoint script loadmodule twice#85
Open
hieu2102 wants to merge 4 commits intovalkey-io:mainlinefrom
Open
Fix entrypoint script loadmodule twice#85hieu2102 wants to merge 4 commits intovalkey-io:mainlinefrom
hieu2102 wants to merge 4 commits intovalkey-io:mainlinefrom
Conversation
…sent in config file Signed-off-by: hieu2102 <hieund2102@gmail.com>
…s list Signed-off-by: hieu2102 <hieund2102@gmail.com>
Signed-off-by: hieu2102 <hieund2102@gmail.com>
Signed-off-by: hieu2102 <hieund2102@gmail.com>
roshkhatri
reviewed
Feb 5, 2026
| # Auto-discover and append all .so modules in MODULE_DIR | ||
| for module in "$MODULE_DIR"/*.so; do | ||
| if [ -n "$(grep "loadmodule $module" "${CONFIG}")" ]; then | ||
| if [ "${CONFIG}" != "" ] && [ -n "$(grep "loadmodule $module" "${CONFIG}")" ]; then |
Member
There was a problem hiding this comment.
Will this handle different path of the module?
like config file has a different path than the one used by bundle?
Contributor
Author
There was a problem hiding this comment.
@roshkhatri it won't, if there are two different paths, then the container will fail to start.
It will also fail if you explicitly loadmodule when the .so file name is different (I guess it is for use cases where you want to use a specific version of the module?).
My purpose for this PR is just to prevent the container from failing to start after running CONFIG REWRITE. If we want comprehensive checks, then I guess it makes more sense to implement it in Valkey
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.
Updated PR from #82, added a check to prevent
grepprint errorgrep: : No such file or directoryif no config file is usedOriginal PR description:
If valkey container is started with a config file, the current
bundle-docker-entrypoint.shscript will still generate the valkey-server command with--loadmoduleflag.If a
CONFIG REWRITEis issued (for example, by a Sentinel client), the loadmodule entries will be written to the config file. Restarting the container will result in a module initialization error (because modules are loaded twice).This PR adds a check to skip the
--loadmoduleflag if the container is started with a config file, and theloadmodule $moduleentry is already present.