MinecraftServerControl / mscs

Powerful command-line control for UNIX and Linux powered Minecraft servers
https://minecraftservercontrol.github.io
BSD 2-Clause "Simplified" License
479 stars 61 forks source link

Dynamic Systemd Units using Service Template #297

Closed LanetheGreat closed 3 years ago

LanetheGreat commented 3 years ago

Hi, big fan of MSCS but found that using the default mscs.service follows a "start all servers, or nothing" approach, so using Systemd's support for template units I added a template unit for MSCS that allows server admins to make individual service units for each server via systemctl.

With this PR, admins can disable the default mscs.service and make/delete units for individual minecraft servers with the following command: sudo systemctl [enable|disable] mscs@[server name]

Or stop/start/restart one, or more servers if they want, using systemctl: sudo systemctl [start/restart/stop] mscs@[server 1 name] [mscs@[server 2 name]] ...

I've tested the install and usage on my own minecraft servers and it seems to work without any issues.

zanix commented 3 years ago

Seems good

sandain commented 3 years ago

This looks good. Thanks for the patch @LanetheGreat