(My post got deleted on Spigot Forums, so posting here. Sorry if I posted on the wrong forum or anything, I haven't used this before)
I'm having trouble getting auto-restart to work. This is my "ServerRestartScript.sh":
However, that .sh file did not load when I used "/restart" and instead, it just stopped. So what I did was look for a solution and apparantley, this was the solution:
I made another sh file called "server.sh":
Then I configured it in spigot.yml:
So surely it should work right? As that helped people out? No. As I go to '/restart' my server, it just stops and doesn't give me an error to say why it won't restart. So exactly the same result as how it was when I just ran ./ServerRestartScript.sh
It just doesn't make sense to me, as reading about 'screen' from this source, it would open a separate terminal instance within a single terminal manager (like a new tab on your browser), so I don't know why that wouldn't work, unless the Java server software was running already when it was starting to close itself, and maybe it didn't like that? No idea.
I'm using PaperSpigot 1.20.4, on a VPS at server.pro. I do have root access to it, however, meaning I could potentially run a command (since there's a built-in scheduler too) that'd check if the Minecraft service is running, and if not, it'd run.
My Minecraft server's directory:
/pro/minecraft-1/paper-1.20.4-399.jar
However, I'm not sure if that'll cause some issues as if it was to already be running, it'd probably still try? Or at least close the other server instance (meaning players would get kicked and get annoyed)?
I need it to work as I do have an auto-restarter feature turned on in this plugin (GeyserUpdater):
However, that'd just do /restart and that'd stop the server, once again. By the way, that plugin did create the script. The regular start.sh script didn't work anyway.
EDIT:
I have made both scripts run as programs, as it was set to off before for some reason. However, that didn't work too. I've attached the gif (it won't upload via link on this forum's proxy to act as a embed or however it works, so using the built-in feature).
I'm having trouble getting auto-restart to work. This is my "ServerRestartScript.sh":
Java:
#!/bin/sh
java -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -Xmx11264M -Xms1024M -jar paper-1.20.4-399.jar nogui
I made another sh file called "server.sh":
Java:
screen -x -R minecraft sh ./ServerRestartScript.sh
YAML:
settings:
timeout-time: 60
restart-on-crash: true
restart-script: ./server.sh
Code:
> restarrestart
[10:43:47 INFO]: [STDOUT] [org.spigotmc.RestartCommand] Attempting to restart with ./server.sh
>
[10:43:47 INFO]: Stopping server
(...plugins unloading)
[10:43:51 INFO]: Saving players
[10:43:52 INFO]: Saving worlds
[10:43:52 INFO]: Saving chunks for level 'ServerLevel[world]'/minecraft:overworld
[10:43:52 INFO]: [ChunkHolderManager] Waiting 60s for chunk system to halt for world 'world'
[10:43:52 INFO]: [ChunkHolderManager] Halted chunk system for world 'world'
[10:43:52 INFO]: [ChunkHolderManager] Saving all chunkholders for world 'world'
[10:43:52 INFO]: [ChunkHolderManager] Saved 529 block chunks, 529 entity chunks, 0 poi chunks in world 'world' in 0.81s
[10:43:52 INFO]: ThreadedAnvilChunkStorage (world): All chunks are saved
[10:43:52 INFO]: Saving chunks for level 'ServerLevel[world_nether]'/minecraft:the_nether
[10:43:52 INFO]: [ChunkHolderManager] Waiting 60s for chunk system to halt for world 'world_nether'
[10:43:52 INFO]: [ChunkHolderManager] Halted chunk system for world 'world_nether'
[10:43:52 INFO]: [ChunkHolderManager] Saving all chunkholders for world 'world_nether'
[10:43:53 INFO]: [ChunkHolderManager] Saved 529 block chunks, 529 entity chunks, 0 poi chunks in world 'world_nether' in 0.60s
[10:43:53 INFO]: ThreadedAnvilChunkStorage (DIM-1): All chunks are saved
[10:43:53 INFO]: Saving chunks for level 'ServerLevel[world_the_end]'/minecraft:the_end
[10:43:53 INFO]: [ChunkHolderManager] Waiting 60s for chunk system to halt for world 'world_the_end'
[10:43:53 INFO]: [ChunkHolderManager] Halted chunk system for world 'world_the_end'
[10:43:53 INFO]: [ChunkHolderManager] Saving all chunkholders for world 'world_the_end'
[10:43:53 INFO]: [ChunkHolderManager] Saved 529 block chunks, 529 entity chunks, 0 poi chunks in world 'world_the_end' in 0.17s
[10:43:53 INFO]: ThreadedAnvilChunkStorage (DIM1): All chunks are saved
[10:43:53 INFO]: ThreadedAnvilChunkStorage: All dimensions are saved
[10:43:53 INFO]: Flushing Chunk IO
[10:43:53 INFO]: Closing Thread Pool
> 2024-01-26 10:43:53,685 Log4j2-AsyncAppenderEventDispatcher-1-Async WARN Advanced terminal features are not available in this environment
[10:43:53 INFO]: Closing Server
I'm using PaperSpigot 1.20.4, on a VPS at server.pro. I do have root access to it, however, meaning I could potentially run a command (since there's a built-in scheduler too) that'd check if the Minecraft service is running, and if not, it'd run.
My Minecraft server's directory:
/pro/minecraft-1/paper-1.20.4-399.jar
However, I'm not sure if that'll cause some issues as if it was to already be running, it'd probably still try? Or at least close the other server instance (meaning players would get kicked and get annoyed)?
I need it to work as I do have an auto-restarter feature turned on in this plugin (GeyserUpdater):
However, that'd just do /restart and that'd stop the server, once again. By the way, that plugin did create the script. The regular start.sh script didn't work anyway.
EDIT:
I have made both scripts run as programs, as it was set to off before for some reason. However, that didn't work too. I've attached the gif (it won't upload via link on this forum's proxy to act as a embed or however it works, so using the built-in feature).
Attachments
Last edited: