Skip to content
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

Generate config only if we need it, do not generate for commands like remote_console/ping #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MikhailKalashnikov
Copy link

Cuttlefish generates new config (and delete old) when we run any command, even if new config files are not required.
I start app with 'bin/appname start' command. Cuttlefish generates new config in generated.conf and application starts with this config.
Then I use remote_console/ping to check my app.
For each call remote_console (and any other command) Cuttlefish generates new config again and deletes the old config files (when we have more than max_history files).
As a result after several remote_console command Cuttlefish deletes config which was created during the app start.
We do not restart app but config files have been deleted.
So we do not know exactly which config was used for the app start.

@tsloughter
Copy link
Collaborator

What about the start command? And what if the release was never started so the config was never generated? Sure the other commands will fail if it isn't running, but now it will fail in a different way that could be more confusing?

But I like the idea.

@MikhailKalashnikov
Copy link
Author

start command actually calls console command so new config will be generated when we call start.

start|start_boot)
        CMD=$1
        case "$1" in
            start)
                shift
                START_OPTION="console" ####      WE SET CONSOLE COMMAND HERE
                HEART_OPTION="start"
                ;;
            start_boot)
                shift
                START_OPTION="console_boot"
                HEART_OPTION="start_boot"
                ;;
        esac

For other commands we do not need config, so even if config never generated we get normal errors. For example:
ping - Node '[email protected]' not responding to pings.
remote_console - Node is not running!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants