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

auto-restart feature #1918

Open
atfrase opened this issue Jan 22, 2023 · 3 comments
Open

auto-restart feature #1918

atfrase opened this issue Jan 22, 2023 · 3 comments

Comments

@atfrase
Copy link

atfrase commented Jan 22, 2023

Enhancement Type

A completely new feature

Describe the enhancement

It would be great to have some options for the server to automatically restart itself under configurable conditions: i.e. no users connected in the last X minutes (similar to the autopause condition), last started more than Y hours ago, only inside a certain time window, etc. When combined with SPIGET_RESOURCES this would also facilitate easier automatic updating of highly version-sensitive plugins such as Geyser, ViaVersion, or ViaBackwards.

@itzg
Copy link
Owner

itzg commented Jan 22, 2023

The requested feature is very difficult to implement fully within the scope of the container. The auto-stop feature

https://github.com/itzg/docker-minecraft-server#autostop

was implemented as a compromise assuming the container had been declared with an appropriate restart policy.

@caitlynrw
Copy link

caitlynrw commented Feb 12, 2023

Yeah, lots of that intricate stuff is hard to get from at the container level, ie number of players online. A while ago I was using this plugin on Paper and just had my container configured to restart unless-stopped and didn't provide a restart script to the plugin and it worked perfectly.

You could theoretically send the list command to the server when it wanted to restart, process the output then restart if able to, but that sounds janky and I don't know if it would make directly interfacing with the server console messy.

EDIT: after digging around actually how this container works, you could probably write a wrapper and use mc-monitor

@itzg
Copy link
Owner

itzg commented Feb 12, 2023

Yeah, "very difficult" == still quite doable 😀 I could see itzg/mc-server-runner#19 being a part of what could feed into this logic.

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

No branches or pull requests

3 participants