Add example usage with Valheim dedicated server

This commit is contained in:
Mikko Ahlroth 2024-07-18 14:15:39 +03:00
parent c51b49b193
commit 936d83a89c
4 changed files with 33 additions and 1 deletions

View file

@ -1,3 +1,3 @@
# valproxy
UDP proxy for Valheim dedicated server Systemd socket activation
UDP proxy for Valheim dedicated server Systemd socket activation.

View file

@ -0,0 +1,13 @@
[Unit]
# BindsTo ensures that the Valheim server will start and be shut down along with the proxy.
BindsTo=valheim.service
After=valheim.service
Requires=valheim-proxy.socket
After=valheim-proxy.socket
[Service]
Type=simple
WorkingDirectory=/home/valheim/valproxy
# This is using asdf to manage the version of Node.js
ExecStart=/home/valheim/.asdf/shims/node index.js 127.0.0.1 2456

View file

@ -0,0 +1,5 @@
[Socket]
ListenDatagram=41831
[Install]
WantedBy=sockets.target

14
systemd/valheim.service Normal file
View file

@ -0,0 +1,14 @@
[Unit]
Description=Valheim server
StopWhenUnneeded=yes
[Service]
Type=simple
WorkingDirectory=/home/valheim/valheim
Environment=LD_LIBRARY_PATH=./linux64
Environment=SteamAppID=892970
ExecStart=/home/valheim/valheim/valheim_server.x86_64 -name "server_name" -port 2456 -nographics -batchmode -world "world_name" -password "password" -public 0
# Important! Always kill with SIGINT so that the server has a chance to save the world.
KillSignal=SIGINT
WatchdogSignal=SIGINT