Skip to content
This repository has been archived by the owner on Jan 18, 2021. It is now read-only.

docker doesnt properly shutdown server - possible world corruption #121

Open
madeofstown opened this issue Jul 13, 2020 · 2 comments
Open
Labels
information not a bug, just gives information

Comments

@madeofstown
Copy link

When using the commands docker stop <containerid> or docker restart <containerid>, docker fails to gracefully stop the server and thus invites corruption of the world files.

You can check this yourself by not auto-removing the container when it stops ( no --rm in your docker start script).
Then stop the server with docker stop <containerid>
Then type: docker inspect -f '{{.State.ExitCode}}' <containerid>
It will return: 137

In fact, an exit status greater than 128 is typically a sign that the process was terminated as a result of an unhandled signal. 137 = 128 + 9 -- meaning that the process was terminated as a result of signal number 9 (SIGKILL).
--https://www.ctl.io/developers/blog/post/gracefully-stopping-docker-containers/

@Weissnix4711 Weissnix4711 added the information not a bug, just gives information label Jul 13, 2020
@Weissnix4711
Copy link
Member

Thanks for the info. I've added this to the wiki as well.

@madeofstown
Copy link
Author

madeofstown commented Jul 13, 2020

If you want to automate server restarts then you should run your docker container in a screen (using the screen command).

Then you can modify this restart script for your needs.
screen -S <screenID> -X stuff 'stop'$(echo -ne '\015') && sleep 10; bash /path/to/<startscript.sh>

Add this to the wiki please

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
information not a bug, just gives information
Projects
None yet
Development

No branches or pull requests

2 participants