-1

i'm trying to install spigot server on debian 10, when i run start.sh:

#!/bin/sh
while true
do
java -Xms4G -Xmx4G -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 - 
XX:+UnlockExperimentalVMOptions -$
echo "restarting in 10"
sleep 10
done

i've got this output: enter image description here

i don't have any idea on how to fix it, any help?

Grainbox
  • 31
  • 3
  • 1
    is this in a separate line "XX:+UnlockExperimentalVMOptions" ? Also what is this "-$" ? – pringi Feb 16 '22 at 17:11
  • no it is on the same line, i didn't write this script, i got it here: https://www.vultr.com/docs/setup-spigot-on-debian-10/ – Grainbox Feb 16 '22 at 17:15
  • There was some issue with your copy paste, that line is much longer in the link you just sent. – Federico Nafria Feb 16 '22 at 17:21
  • **DO NOT post images of code, data, error messages, etc.** - copy or type the text into the question. [ask] – Rob Feb 23 '22 at 14:32

2 Answers2

2

The script seems to require an argument which should be the jar name.

Also, you put a wrong back to break line ("\n") which seems to break the bash.

For me, you should replace -$ by the jar file or spigot, like that:

#!/bin/sh
while true
do
java -Xms4G -Xmx4G -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions spigot-1.18.jar
echo "Restarting in 10 seconds"
sleep 10
done
Elikill58
  • 4,050
  • 24
  • 23
  • 45
2

The script is not correct.

#!/bin/sh
while true
do
java -Xms4G -Xmx4G -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 -jar spigot.jar nogui
echo "restarting in 10"
sleep 10
done

Reference: https://www.vultr.com/docs/setup-spigot-on-debian-10/

pringi
  • 3,987
  • 5
  • 35
  • 45