Closed CatEricka closed 1 year ago
Can you try increasing the wait time for podman to do a SIGKILL? podman stop --time 30 tmodloader-server
or podman stop --time 60 tmodloader-server
.
Depending what the server is doing at the moment, it may not have enough time in 10 seconds to gracefully shutdown.
Command:
$ podman stop --time 60 tmodloader-server
Log:
...
say shutdown...
: <Server> shutdown...
Network is unreachable (see server.log for full trace)
exit
: Saving before exit...
no server running on /tmp/tmux-0/default
no server running on /tmp/tmux-0/default
pgrep: not a number: Main
I tried to use the inject command to exit directly, and it only takes a few seconds.
I'm not sure, it seems the server did saved (according to the file timestamp), but the container still timeout in response to SIGTERM...
root@tmodloader:/terraria-server# ps -aef --forest | more
UID PID PPID C STIME TTY TIME CMD
root 33 0 0 15:40 pts/0 00:00:00 bash
root 332 33 0 15:52 pts/0 00:00:00 \_ ps -aef --forest
root 333 33 0 15:52 pts/0 00:00:00 \_ more
root 1 0 0 15:40 ? 00:00:00 /bin/bash /terraria-server/./entrypoint.sh
root 114 1 0 15:41 ? 00:00:00 /bin/sh /terraria-server/autosave.sh
root 299 114 0 15:51 ? 00:00:00 \_ sleep 10m
root 118 1 0 15:41 ? 00:00:00 tmux new-session -d /terraria-server/LaunchUtils/ScriptCaller.sh -server -steamworkshopfolder "/data/mods/steamapps/workshop" -config "/terraria-server/serverconfig.txt" | tee /tmp/tmod.pipe
root 121 118 0 15:41 pts/1 00:00:00 \_ bash -c /terraria-server/LaunchUtils/ScriptCaller.sh -server -steamworkshopfolder "/data/mods/steamapps/workshop" -config "/terraria-server/serverconfig.txt" | tee /tmp/tmod.pipe
root 123 121 13 15:41 pts/1 00:01:38 \_ /terraria-server/dotnet/6.0.0/dotnet tModLoader.dll -server -steamworkshopfolder /data/mods/steamapps/workshop -config /terraria-server/serverconfig.txt
root 124 121 0 15:41 pts/1 00:00:00 \_ tee /tmp/tmod.pipe
root 120 1 0 15:41 ? 00:00:00 cat /tmp/tmod.pipe
root@tmodloader:/terraria-server# pgrep tmux
118
root@tmodloader:/terraria-server# pgrep --parent 118 Main
root@tmodloader:/terraria-server#
So this loop never ends:
What does pgrep --parent 118 Main
means?
BTW there is missing an -e
:
What does pgrep --parent 118 Main means?
I'm guessing it's part of an early version tModLoader
startup script.
Here is a patch and it works for me: #33
Merged #33 .
After several server restarts I noticed these:
and when I shutdown the server I got this in logs:
and this after command:
~I think the difference between these may be the cause of the problem:~ It's irrelevant.
https://github.com/JACOBSMILE/tmodloader1.4/blob/ed964c4c6fe3c0c99f32de7c847b59cbc23f26ea/entrypoint.sh#L99
https://github.com/rfvgyhn/tmodloader-docker/blob/b7715d98669ed1f2e1d7cca1e5b5520869a357d5/entrypoint.sh#L34