Skip to content

Instantly share code, notes, and snippets.

@jupiterbjy
Last active July 12, 2024 00:21
Show Gist options
  • Save jupiterbjy/0b378b47c937b63d5c4c7a6904272141 to your computer and use it in GitHub Desktop.
Save jupiterbjy/0b378b47c937b63d5c4c7a6904272141 to your computer and use it in GitHub Desktop.

My systemd user service for managing minecraft. I used with screen for years but now decided to ditch it in favor for RCON or ingame commands.

change directories and name accordingly.

mkdir -p ~/.config/systemd/user/
vim ~/.config/systemd/user/simplycreate.service

systemctl --user daemon-reload
systemctl --user start simplycreate.service
systemctl --user status simplycreate.service
[Unit]
Description=SimplyCreate Server
Wants=network-online.target
After=network-online.target
[Service]
WorkingDirectory=/home/mcserver/SimplyCreate/
ExecStart=/home/mcserver/SimplyCreate/run.sh
# sent SIGINT instead for graceful shutdown
ExecStop=/bin/kill -s SIGINT -$MAINPID & /bin/kill -s SIGINT -$MAINPID
Restart=always
RestartSec=30
StandardInput=null
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment