lloesche / valheim-server-docker

Valheim dedicated gameserver with automatic update, World backup, BepInEx and ValheimPlus mod support
https://hub.docker.com/r/lloesche/valheim-server
Apache License 2.0
1.94k stars 272 forks source link

SIGTERM detection #698

Open mmonj opened 3 months ago

mmonj commented 3 months ago

When i do docker compose down the server is killed without the server saving its state. Is there any way that it can detect the SIGTERM signal and save the state immediately?

lloesche commented 1 month ago

The problem isn't the signal, all relevant signals are properly passed through to the server process. The problem is very likely that your Docker daemon kills the container before the Valheim server can save the world to disk because the default timeout is 10s. That's why the docs say to start the container with --stop-timeout 120.