I have migrated to Paper from Spigot setup and I love the performance boost.
I have written a shell script for Spigot server start with a small hack: on start I create named pipe which is passed as a stdin to java process to read from without blocking out further script execution (basically checks and conditions, notifications, emails etc).
The part responsible looks like this:
This worked as intended and is still working with spigot: after shell script finishes the named pipe allows to pass commands to the console without any need to keep the java process open on the screen. I run:
...and it passes the command to the game. No issues.
However that's not the case with Paper core: looks like the core kills the main java process and spawns another one without my fifo input.
I have checked the pids, so I'm pretty sure about process respawning. I need to either disable this respawn or pass my args when respawn happens.
So here's the question: what's the proper way of achieving this in Paper?
Thanks.
I have written a shell script for Spigot server start with a small hack: on start I create named pipe which is passed as a stdin to java process to read from without blocking out further script execution (basically checks and conditions, notifications, emails etc).
The part responsible looks like this:
Bash:
# make named pipe
mkfifo server_console;
# keep it open
exec 3> server_console &
# start the server
java \
<cut here>
-jar server.jar nogui < server_console &>>${_log_file} &
Code:
$ echo "command" > server_console
However that's not the case with Paper core: looks like the core kills the main java process and spawns another one without my fifo input.
I have checked the pids, so I'm pretty sure about process respawning. I need to either disable this respawn or pass my args when respawn happens.
So here's the question: what's the proper way of achieving this in Paper?
Thanks.