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.93k stars 271 forks source link

The connection was disconnected at 5:00 server time. After connecting many times, the connection dropped after connecting. #642

Open TsaiYongChuan opened 1 year ago

TsaiYongChuan commented 1 year ago

https://github.com/lloesche/valheim-server-docker/issues/596

Sep 21 04:55:27 supervisord: valheim-server 09/21/2023 04:55:27: Lobby f3a3e287-1355-4946-8752-fcd9f2d9733d.r-20230509 for world '歪波伟卜' and network 2ee293f6-33e7-4288-b422-2c54a66253be|AwBBYhVK43Uqxl1AvolX0TFQT0BGc1NvdXRoZWFzdEFzaWEAAAAAAAAAXHiiEpapxSC+Owo1h8qJ5NuEOmtS0oeJqq8h6q5ybZZrbk1kbnM4MWU1LThhZDZjMDc1LWQ1NzktNDY2Mi04MmI3LWM2NGQ0MTNkNjAzYS5zb3V0aGVhc3Rhc2lhLmNsb3VkYXBwLmF6dXJlLmNvbQ== refreshed Sep 21 05:00:01 CRON[18106]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0) Sep 21 05:00:01 CRON[18105]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0) Sep 21 05:00:01 CRON[18107]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0) Sep 21 05:00:01 CRON[18109]: (root) CMD (/usr/local/bin/valheim-is-idle && /usr/local/bin/supervisorctl restart valheim-server) Sep 21 05:00:01 CRON[18108]: (root) CMD ([ -f "/var/run/valheim/valheim-updater.pid" ] && kill -HUP $(cat /var/run/valheim/valheim-updater.pid)) Sep 21 05:00:01 CRON[18110]: (root) CMD ([ -f "/var/run/valheim/valheim-backup.pid" ] && kill -HUP $(cat /var/run/valheim/valheim-backup.pid)) Sep 21 05:00:01 CRON[18107]: pam_unix(cron:session): session closed for user root Sep 21 05:00:01 CRON[18106]: pam_unix(cron:session): session closed for user root 2023-09-21 05:00:02,207 INFO waiting for valheim-server to stop Sep 21 05:00:02 supervisord: valheim-server DEBUG - [354] - Received signal to shut down valheim-server Sep 21 05:00:02 supervisord: valheim-server INFO - Shutting down Valheim server with PID 358 Sep 21 05:00:02 supervisord: valheim-server Executing Unity Signal Handler Sep 21 05:00:02 supervisord: valheim-server 09/21/2023 05:00:02: Game - OnApplicationQuit Sep 21 05:00:02 supervisord: valheim-server 09/21/2023 05:00:02: Shuting down Sep 21 05:00:02 supervisord: valheim-server 09/21/2023 05:00:02: ZNet Shutdown Sep 21 05:00:02 supervisord: valheim-server DEBUG - [354] - Waiting for Valheim Server with PID 358 to shut down Sep 21 05:00:02 supervisord: valheim-server 09/21/2023 05:00:02: PrepareSave: clone done in 37ms Sep 21 05:00:02 supervisord: valheim-server 09/21/2023 05:00:02: PrepareSave: ZDOExtraData.PrepareSave done in 55 ms Sep 21 05:00:02 supervisord: valheim-server 09/21/2023 05:00:02: World save writing starting Sep 21 05:00:02 supervisord: valheim-server 09/21/2023 05:00:02: World save writing started Sep 21 05:00:03 supervisord: valheim-server 09/21/2023 05:00:03: Saved 133551 ZDOs Sep 21 05:00:03 supervisord: valheim-server 09/21/2023 05:00:03: World save writing finishing Sep 21 05:00:03 supervisord: valheim-server 09/21/2023 05:00:03: World save writing finished Sep 21 05:00:03 supervisord: valheim-server 09/21/2023 05:00:03: World saved ( 1007.659ms ) Sep 21 05:00:03 supervisord: valheim-server 09/21/2023 05:00:03: Considering autobackup. World time: 43760.76, short time: 7200, long time: 43200, backup count: 4 Sep 21 05

TsaiYongChuan commented 1 year ago

I set -e SERVER_ARGS="-crossplay". How do I operate docker to modify this parameter? I don’t know much about server operations. Thank you.

prime001 commented 1 year ago

Are you running docker command directly or running Docker-compose?

with docker-compose you have a env file with your commands: SERVER_NAME="Prime Norseman" WORLD_NAME=Ragnorok SERVER_PASS=########## SERVER_PUBLIC=false SERVER_ARGS="-crossplay"

but if you look at my issue 70 I mentioned that there is a problem with the valheim-server script.

if you go into the docker container with docker exec -it bash

Use Nano if you don't know vi.

vi /usr/local/bin/valheim-server line:112

LD_PRELOAD=$SERVER_LD_PRELOAD "$valheim_server" -nographics -batchmode -name "$SERVER_NAME" -port "$SERVER_PORT" -world "$WORLD_NAME" -public "$SERVER_PUBLIC" "${password_args[@]}" $SERVER_ARGS > >(fi valheim_server_pid=$!

need to change $SERVER_ARGS to "$SERVER_ARGS"
TsaiYongChuan commented 1 year ago

您是直接运行 docker 命令还是运行 Docker-compose?

使用 docker-compose 你有一个包含命令的 env 文件: SERVER_NAME="Prime Norseman" WORLD_NAME=Ragnorok SERVER_PASS=########## SERVER_PUBLIC=false SERVER_ARGS="-crossplay"

但如果你看一下我的第 70 期,我提到 valheim-server 脚本有问题。

如果你使用 docker exec -it bash 进入 docker 容器

如果您不知道 vi,请使用 Nano。

vi /usr/local/bin/valheim-server 行:112

LD_PRELOAD=$SERVER_LD_PRELOAD "$valheim_server" -ngraphics -batchmode -name "$SERVER_NAME" -port "$SERVER_PORT" -world "$WORLD_NAME" -public "$SERVER_PUBLIC" "${password_args[@]}" $SERVER_ARGS >>( fi valheim_server_pid=$!

need to change $SERVER_ARGS to "$SERVER_ARGS"

I use commands to control. I am familiar with linux commands, but I did not find any relevant files in your path.

[root@VM-12-15-centos ~]# ls Steam valheim-server [root@VM-12-15-centos ~]# cd valheim-server/ [root@VM-12-15-centos valheim-server]# ls config data [root@VM-12-15-centos valheim-server]# cd .. [root@VM-12-15-centos ~]# cd .. [root@VM-12-15-centos /]# cd usr/ bin/ etc/ games/ include/ lib/ lib64/ libexec/ local/ mpi/ sbin/ share/ src/ tmp/
[root@VM-12-15-centos /]# cd usr/local/ bin/ etc/ games/ include/ lib/ lib64/ libexec/ qcloud/ sbin/ share/ src/
[root@VM-12-15-centos /]# vim usr/local/bin/busybox-x86_64 bin/ boot/ data/ dev/ etc/ home/ lib/ lib64/ lost+found/ media/ mnt/ opt/ proc/ root/ run/ sbin/ srv/ sys/ tmp/ usr/ var/
[root@VM-12-15-centos /]# vim usr/local/bin/busybox-x86_64 /usr/ bin/ etc/ games/ include/ lib/ lib64/ libexec/ local/ mpi/ sbin/ share/ src/ tmp/
[root@VM-12-15-centos /]# find usr/ -name valheim [root@VM-12-15-centos /]#

TsaiYongChuan commented 1 year ago

SERVER_ARGS

pre_server_run_hook                                                               
info "Running Valheim Server"                                                               
debug "Server config is name: $SERVER_NAME, port: $SERVER_PORT/udp, world: $WORLD_NAME, public: $SERVER_PUBLIC, mod: $mod_name"
update_server_status starting                                         

chmod +x "$valheim_server"                                                                  
# shellcheck disable=SC2086                                                                                                    
LD_PRELOAD=$SERVER_LD_PRELOAD "$valheim_server" -nographics -batchmode -name "$SERVER_NAME" -port "$SERVER_PORT" -world "$WORLD_NAME" -public "$SERVER_PUBLIC" "${password_args[@]}" "$SERVER_ARGS" > >(filter) 2>&1 &
valheim_server_pid=$!                                                             
unset LD_LIBRARY_PATH                                                                       
unset LD_PRELOAD                                                                                                               
echo $valheim_server_pid > "$valheim_server_pidfile"   

I have made changes, do I need to restart the server now?