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

fix: stop runit services gracefully #44 #145

Merged
merged 3 commits into from
Oct 31, 2024
Merged

Conversation

q0rban
Copy link
Contributor

@q0rban q0rban commented Oct 1, 2024

Resolves #44

Please read that issue for details of the problem and replication instructions.

Inspired by peterbourgon/runsvinit#3, this aims to solve the issue of stopping services gracefully when the docker container is stopped.

Testing instructions

  1. run docker run --rm -it --name tb-test-mariadb-old docker.io/tugboatqa/mariadb
  2. Wait for logs to say that mariadb is ready for connections
  3. In a separate window, run docker stop tb-test-mariadb-old
  4. Note that the logs just end without gracefully shutting down mariadb
  5. check out this branch
  6. run task -- mariadb
  7. run docker run --rm -it --name tb-test-mariadb-new tugboatqa/mariadb
  8. wait for logs to say that mariadb is ready for connections
  9. in a separate window, run docker stop tb-test-mariadb-new
  10. ensure that mariadb shuts down appropriately prior to the container stopping

@q0rban q0rban requested a review from rabbitlair October 1, 2024 22:09
@q0rban
Copy link
Contributor Author

q0rban commented Oct 1, 2024

@apotek, I would love your thoughts on this! :)

Copy link
Contributor

@apotek apotek left a comment

Choose a reason for hiding this comment

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

Comments and questions. Nothing blocking.

templates/Dockerfile.apk.template Outdated Show resolved Hide resolved
dist/tugboat-entrypoint.sh Outdated Show resolved Hide resolved
@q0rban q0rban force-pushed the 44--runit-stop-services branch from aac65ad to 1d98609 Compare October 2, 2024 12:09
@q0rban q0rban force-pushed the 44--runit-stop-services branch from 1d98609 to 5c5b65e Compare October 2, 2024 12:10
@rabbitlair
Copy link
Contributor

Tested, it works like a charm!

rabbitlair
rabbitlair previously approved these changes Oct 2, 2024
@q0rban q0rban merged commit 7b8b80a into main Oct 31, 2024
34 checks passed
@q0rban q0rban deleted the 44--runit-stop-services branch October 31, 2024 14:38
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.

Shut down services gracefully
3 participants