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

Better support for running under supervisorctl via SIGTERM support #113

Open
toptensoftware opened this issue Nov 1, 2018 · 4 comments
Open

Comments

@toptensoftware
Copy link

toptensoftware commented Nov 1, 2018

Currently BaGet waits for Ctrl+C to shutdown. This makes it incompatible with supervisorctl as a way to monitor/control BaGet running on a server - supervisorctl can start the process but fails to stop it properly, leaving dotnet processes running in the background.

See this this post where the developers of supervisorctl make it quite clear that Ctrl+C to stop a running process is not, and won't ever be supported. Supervisor/supervisor#555

It's be great if BaGet could shutdown cleanly in response to a SIGTERM.

@toptensoftware toptensoftware changed the title Better support for running under supervisorctl Better support for running under supervisorctl via SIGTERM support Nov 2, 2018
@loic-sharma
Copy link
Owner

As far as I know, ASP.NET Core should handle this out of the box. This seems like a bug, thanks for reporting!

@toptensoftware
Copy link
Author

I did a little more investigation on this. Seems this is only a problem when BaGet is run via dotnet run. When dotnet publish --self-contained and the generated executable run directly it does shutdown correctly.

For reference, see also: aspnet/Hosting#870

@ksemande
Copy link

I have the same problem myself, except I've tried configuring supervisor to send both SIGTERM and SIGINT (the signal a terminal would send when it receives ctrl-c). I've even tried SIGKILL. The issue is that the dotnet process will exit, but the child node processes continue to run. Since the node process is what's bound to the port, this makes restarting the service impossible without manual intervention. I hope this info helps the devs, and thanks for all your hard work!

@loic-sharma
Copy link
Owner

loic-sharma commented Apr 1, 2019

That's interesting. @ksemande Does this issue reproduce by the app created from the dotnet new react template? BaGet is just a standard ASP.NET Core Single Page Application, so I would expect this issue to affect the standard SPA templates.

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

No branches or pull requests

3 participants