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.89k stars 269 forks source link

Feature Request: Please consider adding support for starting the container via systemd socket activation #693

Open felixc opened 2 weeks ago

felixc commented 2 weeks ago

It would be wonderful (but not trivial!) to add support for starting the container+server via systemd socket activation. It would allow starting the server on-demand, while leaving it not running most of the time. This is a good match for servers that are rarely used and which shouldn't be left on 24/7 consuming system resources.

Since, to my knowledge, Valheim itself does not support socket activation, support would have to be "grafted on" by using proxies such as systemd-socket-proxyd to intercept and buffer the connection while the container and server are launching. From my reading, I get the impression this is possible, but that the easiest way is to have support built-in to the container image itself -- hence this feature request.

Some prior art on adding support to services that do not natively support socket activation:

General background reading:

Of course, another option would be to ask the upstream game developers for native support...

Would also address #687, as mentioned in the comments.

ciphersimian commented 2 weeks ago

https://github.com/lloesche/valheim-server-docker/issues/626#issuecomment-1585765927