Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop the server gracefully with Docker #26

Closed
svenmauch opened this issue May 19, 2021 · 6 comments
Closed

Stop the server gracefully with Docker #26

svenmauch opened this issue May 19, 2021 · 6 comments

Comments

@svenmauch
Copy link

Hi, thank you for maintaining this project!

I was wondering if there is a way to gracefully stop the server using docker. If I'm not mistaken, docker stop sends a SIGTERM to the container, but when inspecting the server output using docker attach it seems there is not the usual output I expect from a stopping Minecraft server (saving world, stopping server).

Am I correct in assuming that this does not stop the server gracefully? If so, would this be an issue that could be fixed by this project or should it be directed at PaperMC?

@mtoensing
Copy link
Owner

I think the server is stopped gracefully if the container is stopped or restarted. Never had an issue with that.

@svenmauch
Copy link
Author

svenmauch commented May 19, 2021

Thanks for the quick response! I just took another look and it seems the server does not stop gracefully. Recently build blocks are lost and the server doesn't stop by unloading plugins and kicking users with the message "server is shutting down".

grafik

I would appreciate a quick look if my compose file is missing anything important or if you have any idea what's causing the different behavior.

services:
  minecraft:
    container_name: minecraft
    image: marctv/minecraft-papermc-server:1.16
    environment:
      MEMORYSIZE: 6G
      TZ: Europe/Berlin
    volumes:
      - './minecraft-data:/data:rw'
    ports:
      - '25565:25565'
    stdin_open: true
    tty: true

I'll try and dig a bit deeper in the meantime.

@mtoensing
Copy link
Owner

The compose file looks okay.

@svenmauch
Copy link
Author

I took a closer look and found out the server was not running as pid 1, therefore not honoring SIGKILL.

It seems this problem only occurs when pulling marctv/minecraft-papermc-server:1.16 from Docker Hub. After pulling the master branch from GitHub, everything works as expected.

Docker Hub:

grafik

GitHub:

grafik

Could there be something wrong with the prebuilt images?

@mtoensing
Copy link
Owner

The images are build on Docker Hub with GitHub as the source. Any idea what could cause this?

@mtoensing
Copy link
Owner

mtoensing commented May 20, 2021

done. Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants