#Minecraft server console buffer not flushing after adding additional startup command

36 messages · Page 1 of 1 (latest)

inland delta
#

Hi i had a question regarding the startup command for a paper mc server (possibly any mc server). Whenever you alter the startup command to have additional commands before you run java, it causes the mc console to never execute any prints as if the buffer is not flushed.

and example of this would be

echo "random echo" && java -Xms128M -XX:MaxRAMPercentage=95.0 -Dterminal.jline=false -Dterminal.ansi=true -jar {{SERVER_JARFILE}}

This causes the console to never actually appear, the only thing it prints to is the error buffer. Is there any particular reason for this? or any fix for this? Since i would like to run additional commands for my server before starting the minecraft instance.

icy cloud
inland delta
#

i feel like wings only prints/flushes the buffer PID 1? and if so how do i work around this? since adding additional commands implies the java command is no longer PID 1

icy cloud
#

huh you sure?

#

because "random" isnt a command in debian based distros

#

ohh nevermind misred it

inland delta
#

im echoing something random

#

just to proof that ANY command causes this, even a simple echo. Literally any command u run through the startup command before running the original java command breaks your console

#

implying that this default provided paper egg is solely for running "java - etc etc etc" hence my question. Since i would like to run additional commands and am looking for a fix/workaround

icy cloud
#

oh you dont do &&

#

it uses a single line argument

#

try using ; to seperate commands

#

try that

#

thats what i saw in the forge startup

inland delta
#

that does not fix it, In this case ; and && are interchangeable. Only difference is that ; implies it will always run the next command and && only runs if the previous command succeeded.

icy cloud
#

hm

inland delta
#

The issue is deeper, related to how wings prints to the console, honestly tho its probably docker itself. Nonetheless, i want to solve this with a genuine fix. I saw others printing everything to the error buffer. But i am also not looking to do that, since that is a very cheap fix in my opinion

icy cloud
#

can you try this?

bash -c "echo 'Random String' && java -Xms128M -XX:MaxRAMPercentage=95.0 -Dterminal.jline=false -Dterminal.ansi=true -jar {{SERVER_JARFILE}}"

inland delta
#

This too will cause the issue, in this case again you run into the issue that the bash echo is pid1 since it ran before java, and then it no longer prints the mc console properly

icy cloud
#

oh

#

try this?
bash -c "echo 'Random String' && exec java -Xms128M -XX:MaxRAMPercentage=95.0 -Dterminal.jline=false -Dterminal.ansi=true -jar {{SERVER_JARFILE}}"

#

exec should just replace the pid1 instead after the first command is used.

#

should

#

havent tried it

inland delta
#

Also would not fix the issue, it does indeed replace pid1 but the buffer is not replaced which is the core issue here. so the stdout buffering mode is still messed up. Causing the console to not show

#

by not running java first there is no PTY allocated, which causes exec to fix nothing

icy cloud
#

use stdbuf

#

something like this?
bash -c "echo 'Setup...' && exec stdbuf -oL -eL java -Xms128M -XX:MaxRAMPercentage=95.0 -Dterminal.jline=false -Dterminal.ansi=true -jar {{SERVER_JARFILE}}"

#

not sure how to use it exactly but ye

#

if that dont work someone else might know a thing or 2

obtuse daggerBOT
#

Please explain the issue you're experiencing in as much detail as possible. Preferably with error messages in a text format or paste link to logs. Nobody can assist you without information that helps to understand the issue. Help us help you. Messages such as "doesn't work" or "i need help" will most likely be ignored.

icy cloud
#

didnt ask you bot

inland delta