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

Docker shutdown signal not passed on #14

Closed
1 task done
uncaught opened this issue Jan 21, 2024 · 11 comments
Closed
1 task done

Docker shutdown signal not passed on #14

uncaught opened this issue Jan 21, 2024 · 11 comments
Assignees
Labels
issue-inconclusive Problem could not be found

Comments

@uncaught
Copy link

uncaught commented Jan 21, 2024

Have you read the Important information text above

  • Yes i did

Current behavior

When stopping the container, it seems to get killed after the stop_grace_period (default 10s).

Desired behavior

The stop signal should be passed onto the underlying service so that it shuts down cleanly within the grace period.

If the clean shutdown takes longer than 10 seconds, the image should set a higher grace period.

Links to screenshots

No response

To Reproduce

Steps to reproduce the behavior:

  1. Stop the container
  2. See it always stops after 10 seconds

Software setup

  • OS: Ubuntu 22.04
  • Docker: 24.0.4
  • Docker compose: 2.19.1

Hardware setup

  • vCPU: 6
  • RAM: 16G
  • Disk: 280G SSD

Additional context

No response

@0Downtime
Copy link

This would be helpful since the server needs rebooted every 2 hours due to memory leak.

@jammsen
Copy link
Owner

jammsen commented Jan 21, 2024

@jammsen jammsen self-assigned this Jan 21, 2024
@jammsen jammsen added the issue-inconclusive Problem could not be found label Jan 21, 2024
@uncaught
Copy link
Author

uncaught commented Jan 22, 2024

Yes, your entrypoint (servermanager.sh) needs to delegate the signals to the services it starts.

I don't know where PalServer.sh comes from, but if that handles a shutdown signal (the docker stop signal can be adjusted), then maybe this could already do the trick:

-    ./PalServer.sh "$START_OPTIONS"
+    exec ./PalServer.sh "$START_OPTIONS"

exec will replace the top level process, so the signals go there now.

Not sure if you need your own process running still though.

@jammsen
Copy link
Owner

jammsen commented Jan 22, 2024

Hey @uncaught
the PalServer.sh comes with the server, it sets some unreal-engine things.
PalServer.sh:

#!/bin/sh
UE_TRUE_SCRIPT_NAME=$(echo \"$0\" | xargs readlink -f)
UE_PROJECT_ROOT=$(dirname "$UE_TRUE_SCRIPT_NAME")
chmod +x "$UE_PROJECT_ROOT/Pal/Binaries/Linux/PalServer-Linux-Test"
"$UE_PROJECT_ROOT/Pal/Binaries/Linux/PalServer-Linux-Test" Pal "$@" 

But im working on a fix for that, a collegue of mine has something the might work and he was okay with me using it.

@jammsen
Copy link
Owner

jammsen commented Jan 22, 2024

Fix is applied in my local version:

Console

palworld-dedicated-server  | [S_API FAIL] Tried to access Steam interface SteamUser021 before SteamAPI_Init succeeded.
palworld-dedicated-server  | [S_API FAIL] Tried to access Steam interface SteamFriends017 before SteamAPI_Init succeeded.
palworld-dedicated-server  | [S_API FAIL] Tried to access Steam interface STEAMAPPS_INTERFACE_VERSION008 before SteamAPI_Init succeeded.
palworld-dedicated-server  | [S_API FAIL] Tried to access Steam interface SteamNetworkingUtils004 before SteamAPI_Init succeeded.
^CGracefully stopping... (press Ctrl+C again to force)
[+] Stopping 1/1
 ✔ Container palworld-dedicated-server  Stopped                                                                                                     3.3s
palworld-dedicated-server exited with code 0
canceled

3.3 instead of 10 🚀

docker-compose logs -f

palworld-dedicated-server  | [S_API FAIL] Tried to access Steam interface SteamUser021 before SteamAPI_Init succeeded.
palworld-dedicated-server  | [S_API FAIL] Tried to access Steam interface SteamFriends017 before SteamAPI_Init succeeded.
palworld-dedicated-server  | [S_API FAIL] Tried to access Steam interface STEAMAPPS_INTERFACE_VERSION008 before SteamAPI_Init succeeded.
palworld-dedicated-server  | [S_API FAIL] Tried to access Steam interface SteamNetworkingUtils004 before SteamAPI_Init succeeded.
palworld-dedicated-server  | FUnixPlatformMisc::RequestExitWithStatus
palworld-dedicated-server  | FUnixPlatformMisc::RequestExit
palworld-dedicated-server  | dlmopen steamservice.so failed: steamservice.so: cannot open shared object file: No such file or directory
palworld-dedicated-server  | Exiting abnormally (error code: 143)
palworld-dedicated-server  | Shutdown handler: cleanup.

This should do the trick i think. @uncaught

@uncaught
Copy link
Author

3.3 seconds sounds good :)

jammsen added a commit that referenced this issue Jan 22, 2024
…ample from the community to run easy RCON commands, #14 Added mechanic to handle signals better, #10 Added compability
@jammsen
Copy link
Owner

jammsen commented Jan 22, 2024

Please go ahead and test things.
New Docker-Compose File is needed.
You can find now examples in the README.md.
The docker-compose.yml was removed because of dublicate code.

@jammsen
Copy link
Owner

jammsen commented Jan 23, 2024

If this issue is solved, please give me feedback on the patch and please consider giving me a Star here and on Docker-Hub.

@jammsen
Copy link
Owner

jammsen commented Jan 23, 2024

@uncaught Ping please read the last 2 comments and tell me things

@uncaught
Copy link
Author

I've seen it, but can't test, yet. I've been shutting down the server via rcon lately and it's not running right now. (Damn memory leak ;) )

I've been using the updated script though already since yesterday.

I'm going to assume this is solved (until they change the name of PalServer-Linux-Test I guess ;) ).

@jammsen
Copy link
Owner

jammsen commented Jan 23, 2024

Well its their binary and their shell-script, up to them to manage that beast, hehe 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue-inconclusive Problem could not be found
Projects
None yet
Development

No branches or pull requests

3 participants