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

Added check if there is already a running instance of health-check.sh #30

Merged
merged 1 commit into from
Oct 17, 2021
Merged

Conversation

sidey79
Copy link
Contributor

@sidey79 sidey79 commented Dec 31, 2020

Added check to avoid running a new instance if there is one already running

Added check to avoid running a new instance if there is one already running
@sidey79
Copy link
Contributor Author

sidey79 commented Feb 21, 2021

@jpawlowski

Wie kommen wir hier weiter?
Willst Du die Repo Rechte ggf. weitegeben?

Copy link
Contributor

@jpawlowski jpawlowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please implement changes mentioned before and provide some explanation about e2e integration test results (e.g. screenshot of health check status in Docker and log file excerpt to demonstrate added value of these code lines are being used in practice).

RUNNING_INSTANCES=$(pgrep -f "/bin/sh -c /health-check.sh" | wc -l)

if [ "${RUNNING_INSTANCES}" -gt "1" ]; then
echo "Instance already running, aborting another one"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

echoing here does not make sense as it will replace status appearance of the existing instance in docker status overview.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the docs

To help debug failing probes, any output text (UTF-8 encoded) that the command writes on stdout or stderr will be stored in the health status and can be queried with docker inspect. Such output should be kept short (only the first 4096 bytes are stored currently).

This output should help, if there is already a running instance of the health check to report this, that something isn't correct at all.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jpawlowski

How we can proceed here?

@CoolTuxNet CoolTuxNet changed the base branch from dev to patch_marko-bullseye October 17, 2021 16:33
@CoolTuxNet CoolTuxNet merged commit 96b06d0 into fhem:patch_marko-bullseye Oct 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants