Comments (8)
ok this seems cool!
just to know:
this does not work at all?
# listen for interrupt signal and issue stopEmptyMinecraftServer(true) before exiting
atexit.register(stopEmptyMinecraftServer, forceExec=True)
because for me it seemed to do the job..
from minecraft-server-hibernation.
Well, pressing ctrl + c
on Windows doesn't do anything and pressing it on Linux (two presses needed to actually stop the script) the following happens:
Copyright (C) 2019-2020 gekigek99
v6.6 (Python)
visit my github page: https://github.com/gekigek99
12-Oct-20 16:48:43 *** listening for new clients to connect...
^CTraceback (most recent call last):
File "minecraft-vanilla-server-hibernation.py", line 534, in <module>
main()
File "minecraft-vanilla-server-hibernation.py", line 145, in main
clientSocket, clientAddress = listener.accept() #blocking
File "/usr/lib/python3.8/socket.py", line 292, in accept
fd, addr = self._accept()
KeyboardInterrupt
^CException ignored in: <module 'threading' from '/usr/lib/python3.8/threading.py'>
Traceback (most recent call last):
File "/usr/lib/python3.8/threading.py", line 1388, in _shutdown
lock.acquire()
KeyboardInterrupt:
As such I tried to intercept the KeybordInterrupt with the signal listener and since a simple sys.exit(0)
didn't work, I tried consolidating all spawned threads back into the main thread before exiting. Upon exit the functions registered with atexit.register
for execution should still be executed. Although, as it is, it's not quite finished and still doesn't properly exit.
from minecraft-server-hibernation.
Will test if mc server gets shutdown on Windows when closing console and in Linux after two times ctrl + c
.
If not, this is a bug. If yes, then enhancement status stays.
from minecraft-server-hibernation.
facepalm os.Exit(0) needs to be written in Uppercase...
from minecraft-server-hibernation.
facepalm os.Exit(0) needs to be written in Uppercase...
Wait... the uppercase thing is used in golang and I think it'correct to write sys.exit()
in python
from minecraft-server-hibernation.
@lubocode since python is deprecated i will now close the issue... unless we want to solve this last one
I can create a branch from commit c5804b6 and re-release version 9.12 with this bug corrected
from minecraft-server-hibernation.
facepalm os.Exit(0) needs to be written in Uppercase...
Wait... the uppercase thing is used in golang and I think it'correct to write
sys.exit()
in python
... Oops.
@lubocode since python is deprecated i will now close the issue... unless we want to solve this last one
I can create a branch from commit c5804b6 and re-release version 9.12 with this bug corrected
Well, no. It's not exactly nice interrupt handling, but this is also not a bug, as the server is correctly shutting down upon exit. On Windows ctrl+c
might not work, but closing the cmd window, in which the python script got started, also shuts down the server.
from minecraft-server-hibernation.
On Windows ctrl+c might not work, but closing the cmd window, in which the python script got started, also shuts down the server.
a okok fiuuu so now i'm in peace with myself. so i think I can move on.
from minecraft-server-hibernation.
Related Issues (20)
- Stopping msh with `msh exit` while ssh'ed prevents text input in cli. HOT 1
- connection count (0) different from list command player count (10) [00f500] HOT 4
- Support for MS Bedrock HOT 9
- Docker container start / stop support HOT 2
- add `ServPort` and `ServPortQuery` start parameter HOT 1
- help with forge minecraft server setup (bat/ps1 server launcher script) HOT 1
- Timeout at login HOT 3
- Forge Servers 1.17+ Installation Impossible HOT 3
- Line break in the middle of logs lines
- Add detection for placeholder players
- Conflict on stop detection
- Failure to loadDefault HOT 1
- Add option to set default target application
- MSH crash on start HOT 1
- add log to file functionality
- Unfreeze Server on POSIX signal
- Automatic Queue System HOT 1
- [Feature Request] - named pipe support
- Create an alias from "mine" to "/". HOT 2
- Server shutting down automatically even with players connected HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from minecraft-server-hibernation.