valheim-server-docker icon indicating copy to clipboard operation
valheim-server-docker copied to clipboard

SIGTERM detection

Open mmonj opened this issue 1 year ago • 1 comments

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?

mmonj avatar Jul 27 '24 04:07 mmonj

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.

lloesche avatar Sep 13 '24 10:09 lloesche

I just got passed an issue where state was not saving upon docker stop, even with proper timeouts, in an Azure ubuntu 24 VM, once I rolled back to ubuntu 22, it worked again, I didn't get the chance to investigate further tho.

I monitored the logs after docker stop and got nothing, container wouldn't log anything and then would just exit.

rdalbuquerque avatar Nov 12 '24 03:11 rdalbuquerque

Interesting - although why the host VM OS version has an influence on how signals are propagated inside the container I don't know. We were witnessing issues when upgrading the container base image itself from Debian 10 to 11, which is why there's still a debian10 branch. I'm currently running the container on Fedora 41 with latest 6.13 kernel no problem.

lloesche avatar Mar 23 '25 14:03 lloesche