BDS not stopping gracefully when running as a service
Summary
BDS does not respond to standard server signals.
Steps to reproduce... (windows)
- Download and unzip BDS
- Download and unzip NSSM
- Configure BDS as a service and start - ensure you enable logging for easiest eval
- Stop the service using cmd/powershell/services.msc
- 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.
Created Issue:
Launch with systemd (Ubuntu), and attach to running service
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!
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!
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!
is duplicated by
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 ( ? )theserver, 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!
Summary
BDS does not respond to standard server signals.
Steps to reproduce... (windows)
- Download and unzip BDS
- Download and unzip NSSM
- Configure BDS as a service and start - ensure you enable logging for easiest eval
- Stop the service using cmd/powershell/services.msc
- 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.
Launch with systemd (Ubuntu), and attach torunning serviceBDS not stopping gracefully when running as a service
is duplicated by
Hi Kysput,
This isn't really the place to ask, in general discussion like this should happen on one of the options more appropriate for discussion (such as the Reddit or Discord Server).
BDS is currently still listed as an alpha (which means its feature incomplete), there is a specific section on the feedback website to provide dedicated server feedback. Some of the issues you mention can be achieved by wrapping the provided executable in a script or similar and there are some already out there.
To answer a couple of them though (numbering it):
- The stop command is currently the only way to gracefully stopping the server, there are certain wrappers for linux that resolve this (without modding the server itself). We're tracking this as
BDS-203 - Not currently, head to https://feedback.minecraft.net to suggest new features.
- This sounds like a technical issue rather than a bug with the Minecraft executable, if you think its a bug please log a report but make sure to include all the information we need in a report.
BDS-8262is an example. - Not currently, head to https://feedback.minecraft.net to suggest new features.
- Not currently, head to https://feedback.minecraft.net to suggest new features.
- No inbuilt method, there are commands you can use (detailed in the how to document provided with the download) that you can use with a custom wrapper.
- As far as I know its not possible but someone on the Discord may have a better idea.
- You can, from the console? All commands should work from the console unless they rely on a player running them (although I can't think of any that do off the top of my head).
- (coords) You can't for individual players, at least not natively. (tps) Not currently, head to https://feedback.minecraft.net to suggest new features
Thank you for your report!
We're tracking this issue in BDS-203, so this ticket is being resolved and linked as a duplicate.
If you would like to add a vote and any extra information to the main ticket it would be appreciated.
If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.
Quick Links:
📓 Bug Tracker Guidelines – 📧 Mojang Support
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 BDS Wiki – 📖 FAQs
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.
Can either of you please provide steps on how to achieve this?
This comment gives an example: https://bugs.mojang.com/browse/BDS-56?focusedCommentId=490680&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-490680
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