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

Fix rebooting when players are online. #556

Closed wcdanh2 closed 1 year ago

wcdanh2 commented 1 year ago

When the cron job for the daily reboot launches valheim_is_idle which subsequently launches valheim-status, valheim-status does not have the environment variables it needs and falls back to defaults. On servers that are not using the default ports this causes the status to timeout which is treated as 0 players online resulting in a reboot even when players are online.

This patch modifies the crontab file so that the cron environment will have SERVER_PORT and STATUS_HTTP_HTDOCS which are the 2 parameters that valheim-status tries to get from the environment.

wcdanh2 commented 1 year ago

I haven't gotten the pr modified yet but, I found that "SERVER_PUBLIC" also needs to be added.

I'll make a new pr if this is already merged (hard to see on my phone)