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

[feature request] Allow user defined stop hook #5135

Open
stevendanna opened this issue May 30, 2018 · 8 comments
Open

[feature request] Allow user defined stop hook #5135

stevendanna opened this issue May 30, 2018 · 8 comments
Labels
Focus:Hab-Automate Relevant to the A2 Chef Team Focus:Supervisor ProcessManagement Related to how the Supervisor manages service processes Focus:Supervisor Related to the Habitat Supervisor (core/hab-sup) component Status:Help Wanted Type:Feature PRs that add a new feature Type: Feature Issues that describe a new desired feature
Milestone

Comments

@stevendanna
Copy link
Contributor

stevendanna commented May 30, 2018

Occasionally, properly shutting down a service requires something other than simply sending a SIGTERM. For example, we would like our default PostgreSQL shutdown behavior to be the "Fast Shutdown" that is documented here:

https://www.postgresql.org/docs/9.6/static/server-shutdown.html

Other process supervisors such as runit allow users to customize the shutdown behavior (http://smarden.org/runit/runsv.8.html). It would be good if Habitat allowed something similar.

A stop hook would fit in nicely with the existing lifecycle hooks.

The stop hook would also benefit from a documented and supported way to reference the main PID under supervision.

@baumanj
Copy link
Contributor

baumanj commented Jun 18, 2018

Still valid, post v0.56

@baumanj baumanj removed their assignment Jun 18, 2018
@baumanj baumanj added this to the Supervisor Usability milestone Jun 18, 2018
@gfodor
Copy link

gfodor commented Jun 29, 2018

I have a similar issue here, proposing a number of hooks: #4923

@HT154
Copy link

HT154 commented Aug 15, 2018

If I'm understanding this correctly, then I think core/rabbitmq already does something like this, albeit in a roundabout way:

https://github.com/habitat-sh/core-plans/blob/22ee0017e85611b756bdfb7a3ad8e3fe35c994e0/rabbitmq/hooks/run#L32-L37

@stevendanna
Copy link
Contributor Author

For the stop hook to be useful, my guess is we will also need a configurable timeout as described in #2447

@stale
Copy link

stale bot commented Apr 2, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We value your input and contribution. Please leave a comment if this issue still affects you.

@stale stale bot added the Stale label Apr 2, 2020
@stevendanna
Copy link
Contributor Author

While the configurable signal and timeout that was added cover many use cases, I still think we should consider supporting stop hooks or close this with a clear statement of why we don't want them.

A number of services create their own "stop" hooks by installing a signal handler as part of their run hook.

@stale stale bot removed the Stale label May 11, 2020
@christophermaier christophermaier added Type:Feature PRs that add a new feature Focus:Supervisor Related to the Habitat Supervisor (core/hab-sup) component and removed X-feature labels Jul 24, 2020
@christophermaier christophermaier added Type: Feature Issues that describe a new desired feature and removed A-supervisor labels Jul 24, 2020
@stale
Copy link

stale bot commented Aug 12, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We value your input and contribution. Please leave a comment if this issue still affects you.

1 similar comment
@stale
Copy link

stale bot commented Aug 12, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We value your input and contribution. Please leave a comment if this issue still affects you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Focus:Hab-Automate Relevant to the A2 Chef Team Focus:Supervisor ProcessManagement Related to how the Supervisor manages service processes Focus:Supervisor Related to the Habitat Supervisor (core/hab-sup) component Status:Help Wanted Type:Feature PRs that add a new feature Type: Feature Issues that describe a new desired feature
Projects
None yet
Development

No branches or pull requests

8 participants