-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix START_CMD implementation #576
Conversation
I'd prefer to treat cosmovisor like snapshot, i.e. Also, the separation between args ($@ case) and $START_CMD case is intentional, because the latter breaks when one of the args has includes a space. |
exec $PREFIX_CMD "$@" | ||
elif [ -n "$START_CMD" ]; then | ||
exec $PREFIX_CMD $START_CMD | ||
export START_CMD="$@" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would break if docker command has an arg that includes a (white)space, e.g. docker run .... arg1 arg2 "third arg" ...
- the exec statements at lines 364/367 will not preserve the quotes. That s why the previous version kept the two cases - docker args and START_CMD - separately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might need tweaking a bit further then, but should be an easy enough change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can take a look over the next few days unless you want to submit a PR, but could you raise an issue to explain it if not?
The problem with that is cosmovisor can only run commands directed to the node binary, so you'd need to disable cosmovisor support if you want to run any other command, e.g. a simple |
Adjusts the
START_CMD
implementation so that:START_CMD
arg/env variable if setcosmovisor run start
ifCOSMOVISOR_ENABLED
$PROJECT_BIN start
snapshot.sh
script is always used ifSNAPSHOT_PATH
is set, with the command it runs set by the above logicAlso documents Cosmovisor support in the README, and adds a bit more logging so it's clear what's happening.
I considered adding a
SNAPSHOT_ENABLED
env instead of implicitly enabling withSNAPSHOT_PATH
, but decided not to change that yet.