- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Wings mishandles signals #4783
Comments
I've got the same issue with my panel, Running the same versions for panel and wings. Docker is on version 24.0.2 |
My best guess is still that this is related to the fact that we use |
The use of eval is an issue, but it is separate to the issues described in this report. The issues I've reported are entirely valid on their own. I've had a few people say it worked a few versions back but nobody could tell me exactly what version they claim it broke. |
This comment was marked as abuse.
This comment was marked as abuse.
Just to clear, you're saying Panel version 1.10.1 with wings 1.7.0 is the Pterodactyl release you claim worked as you expected it to ?
We have a half ready patch that resolves these issues, Once I can get it clean and PR ready Ill post it. |
problem is, Matthew is the only one, which can merge sth |
Yep, it know that's a pain. I'd love to see my unrar fix merged as well. I'm happy to provide a build myself that includes my fixes when my PR is ready. |
This comment was marked as abuse.
This comment was marked as abuse.
sorry; had overlooked that. |
Thank you for the additional info, I'll incorporate that version of docker into my test environment when I can, but I'm a little swamped next few days. |
I have a patch + build here for testing/comments @gOOvER tagged because I know you wanted to test |
Reopening as I haven't seen anything that fixes this. |
Fixes pterodactyl/panel#4783 Requires pterodactyl/panel#5132 to work
@danny6167 I notice that this was merged 3 weeks ago and I wanted to ask if it's in the latest release of Wings. When I run If this isn't in the release yet, how would I get support for this? I'm hoping to migrate my Minecraft servers to Pterodactyl but I need the guarantee of graceful shutdowns if I simply run |
Hey @bobbyl140, This hasn't made it to a released version yet (hopefully soon) but this doesn't have anything to do with how docker stops a container when using I haven't been working on a shutdown hook script that would do what you want, no guarantees, but if it ever reaches a half usable state I'll let you know. |
Ah, I’m sorry. If it’s okay to ask, is there anything I could programmatically call to safely shut everything down? Or if I was to try making one myself, where could I start? |
My solution I'm building is using systemd shutdown triggers, that calls a script that calls the wings API directly (to wings, not the panel) to request a shutdown and poll till they are all stopped. |
I see, thank you! |
Current Behavior
Wings currently mishandles stop signals in a number of ways.
^C isn’t actually ^C
^C should issue a SIGINT to the container (as per convention and the panels text) however it is handled specially by the panel.
The panel translates this into {‘type’: ‘stop’, ‘value’: null } thus instructing wings to handle what should be a SIGINT as a generic container stop.
Meaning when Stop() is called in power.go is skips most of the handling and just calls ContainerStop() with no signal specified.
When no signal is specified ContainerStop() defaults to SIGTERM, not the SIGINT that was expected. For some applications this will result in a quick death without completing on exit actions such as saving game.
Most ^SIGNALS don’t work at all
Users are supposed to be able to enter ^SIGABRT, ^SIGINT, ^SIGTERM, etc however issues with wings codes prevents the signal from being processed in a format that is correct for the docker API calls.
The
syscall.<SIGNAL>
is passed to the Terminate() function where it is converted to a string representation, and then (after some trimming) is passed to the ContainerKill() function.The docker API reference (https://docs.docker.com/engine/api/v1.18/#kill-a-container) says the API that this function calls expects a string in the format of “SIGINT”, “SIGTERM”, “SIGKILL”, but my testing also shows that it accepts strings such as “int”, “term”, “kill”.
syscall.<SIGNAL>.String()
returns strings such as “killed”, “interrupt”, or “terminate”. Current wings code trims the “ed” off “killed” and allows that signal to work, however none of the others are turned into valid strings for the API.All signals are handled by Terminate()
The intended flow of wings code uses Terminate() to handle all signals however Terminate() make the assumptions that once it sends a signal that the container is dead. Not all signals would result in immediate termination of the container and (once the above issues are fixed) the container can stick around long after wings has marked the container as stopped.
Expected Behavior
The correct signal should be sent to the container.
Wings should not assume that a container stopped after a signal was sent to it.
Steps to Reproduce
Use different signals as stop actions and observe signals received by the container using bash traps.
Also witness errors in wings logs for ^SIGINT, ^SIGABRT, ^SIGTERM
Panel Version
1.11.3
Wings Version
1.11.6
Games and/or Eggs Affected
No response
Docker Image
No response
Error Logs
Is there an existing issue for this?
The text was updated successfully, but these errors were encountered: