© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
AdmincraftA
Admincraft•2y ago•
7 replies
swalloich

Starting and stopping a headless server using Systemd service

I'm running a fabric server on an Oracle cloud vm running oracle linux. The server is managed by a daemon user and a systemd service. I can start the server fine using
sudo systemctl start minecraft-server
sudo systemctl start minecraft-server
, but when I stop, it gives me an error in the log:
stop.sh: Error: connection failed (localhost).
systemd: minecraft-server.service: Control process exited, code=exited status=255
systemd: minecraft-server.service: Failed with result 'exit-code'
stop.sh: Error: connection failed (localhost).
systemd: minecraft-server.service: Control process exited, code=exited status=255
systemd: minecraft-server.service: Failed with result 'exit-code'

It then proceeds to stop, despite the error implying that it couldn't.

My server starts by running the command:
java -Xmx6G -jar fabric-server.jar nogui
java -Xmx6G -jar fabric-server.jar nogui
in a bash script called
start.sh
start.sh
. It is stopped by running
<absolute_path>/mcrcon -c -H localhost -P <port> -p $RCON_PASSWORD stop
<absolute_path>/mcrcon -c -H localhost -P <port> -p $RCON_PASSWORD stop
in a bash script called
stop.sh
stop.sh
.

Is there a more graceful way to start and stop the server that I'm not aware of?

EDIT: Turns out the server does not stop. The log says it does, but the process is still running in the background.
AdmincraftJoin
10,704Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

My paper server keeps starting and stopping
AdmincraftAAdmincraft / questions
3y ago
Starting a SMP and gaining server staff.
AdmincraftAAdmincraft / questions
4mo ago
Forge auto start and stopping server by user
AdmincraftAAdmincraft / questions
3y ago
Server starting issues
AdmincraftAAdmincraft / questions
12mo ago