Mojira Archive
BDS-203

BDS not stopping gracefully when running as a service

Summary

BDS does not respond to standard server signals.

Steps to reproduce... (windows)

  1. Download and unzip BDS
  2. Download and unzip NSSM
  3. Configure BDS as a service and start - ensure you enable logging for easiest eval
  4. Stop the service using cmd/powershell/services.msc
  5. Note in the log that the server immediately terminates rather than running a safe shutdown

What I expected to happen...

BDS should handle the termination signal gracefully to allow BDS to be configured as a service.

What actually happened...

Server immediately terminated, risking corruption etc.

How this affects admins

At the moment its possible to configure BDS as a service and it works without issue. However when restarting the host or even just the service, it terminates immediately causing an unsafe shutdown and risking corruption.

Linked Issues

Comments8

Currently the way most server owners do this is by using the screen package. I will agree though, it would be nice if the server could detect that the operating system is shutting down and gracefully stop itself.

Thanks, Jacob. "screens" was a helpful tip.

I found this, which was written for the Java version, but adapted works for Bedrock too:

https://gist.github.com/justinjahn/4fe65b552b0622662420928cc8ffc7c0

I have had really good luck running the server in a docker container. https://github.com/cdunkelb/bedrocker

The report as it currently stands is more of a feature request (the ability to run BDS as a service etc) which need to be submitted over at the feedback site (https://feedback.minecraft.net).

However, the way BDS reacts when running as a service (not shutting down cleanly as described in BDS-437 - not obeying service termination signals) I would consider a bug .

I've updated the summary to focus on that issue and confirmed the report.

Hi

Does this issue still occur after updating to 1.17.34?

This ticket will automatically reopen when you reply.

Cleaning up old tickets: This ticket had been set to 'Awaiting Response', but has not received a response from the reporter (~3 months+) so is being closed as Incomplete. If you feel this is still a valid issue then please comment, or create a new ticket following the Issue Guidelines which includes steps to reproduce the problem.

Quick Links:
📓 Issue Guidelines – 💬 Mojang Support – 📧 Suggestions – 📖 Minecraft Wiki

History12

[Mod] bemoty

Added description:

Would be great to eventually have the Bedrock server more easily integrate with systemd/systemctl on Ubuntu, for starting on system boot-up, re-starting on failure, etc.

I can do it now, but it's kind of hack-y. For example, once systemd starts the Bedrock server, there's no good way to have it gracefully stop, it must kill the process.

Along the same line, if we're daemonizing ( ? ) the server, it'd be nice to have some way to attach to a running server in order to run commands.

Example : ./bedrock_server attach

I'd even settle for some way to run commands one-off, so I could properly shut down a running server.

Example : ./bedrock_server command stop

Thanks!

Removed environment:

Would be great to eventually have the Bedrock server more easily integrate with systemd/systemctl on Ubuntu, for starting on system boot-up, re-starting on failure, etc.

I can do it now, but it's kind of hack-y. For example, once systemd starts the Bedrock server, there's no good way to have it gracefully stop, it must kill the process.

Along the same line, if we're daemonizing ( ? ) the server, it'd be nice to have some way to attach to a running server in order to run commands.

Example : ./bedrock_server attach

I'd even settle for some way to run commands one-off, so I could properly shut down a running server.

Example : ./bedrock_server command stop

Thanks!

IonicEcko

Added Confirmation Status: Unconfirmed

IonicEcko
IonicEcko

Changed description:

Would be great to eventually have the Bedrock server more easily integrate with systemd/systemctl on Ubuntu, for starting on system boot-up, re-starting on failure, etc.

0

I can do it now, but it's kind of hack-y. For example, once systemd starts the Bedrock server, there's no good way to have it gracefully stop, it must kill the process.

0

Along the same line, if we're daemonizing ( ? ) the server, it'd be nice to have some way to attach to a running server in order to run commands.

0

Example : ./bedrock_server attach

0

I'd even settle for some way to run commands one-off, so I could properly shut down a running server.

0

Example : ./bedrock_server command stop

0

Thanks!

Summary

0

BDS does not respond to standard server signals.

0

Steps to reproduce... (windows)

0
    0
  1. Download and unzip BDS
  2. 0
  3. Download and unzip NSSM
  4. 0
  5. Configure BDS as a service and start - ensure you enable logging for easiest eval
  6. 0
  7. Stop the service using cmd/powershell/services.msc
  8. 0
  9. Note in the log that the server immediately terminates rather than running a safe shutdown
  10. 0
0

What I expected to happen...

000

BDS should handle the termination signal gracefully to allow BDS to be configured as a service.

0

What actually happened...

00

Server immediately terminated, risking corruption etc.

0

How this affects admins

0

At the moment its possible to configure BDS as a service and it works without issue. However when restarting the host or even just the service, it terminates immediately causing an unsafe shutdown and risking corruption.

0

IonicEcko

Confirmation Status: UnconfirmedConfirmed

Changed summary:

Launch with systemd (Ubuntu), and attach to running service BDS not stopping gracefully when running as a service

Maciej Piornik
[Bot] Arisa

Added affects versions: 1.9.0.15 1.16.201.03 Hotfix

Maciej Piornik
Maciej Piornik
Maciej Piornik

Resolution: UnresolvedIncomplete

Incomplete
Paul K
2
2
Confirmed
1.6.1.0 1.9.0.15 1.16.201.03 Hotfix