mirror of
https://github.com/MinecraftServerControl/mscs.git
synced 2024-11-14 22:38:18 -07:00
Added mscs@.service template for starting individual servers as systemd units.
This commit is contained in:
parent
ee00f9a5c8
commit
53bcb39a23
4
Makefile
4
Makefile
@ -5,6 +5,7 @@ MSCTL := /usr/local/bin/msctl
|
|||||||
MSCS := /usr/local/bin/mscs
|
MSCS := /usr/local/bin/mscs
|
||||||
MSCS_INIT_D := /etc/init.d/mscs
|
MSCS_INIT_D := /etc/init.d/mscs
|
||||||
MSCS_SERVICE := /etc/systemd/system/mscs.service
|
MSCS_SERVICE := /etc/systemd/system/mscs.service
|
||||||
|
MSCS_SERVICE_TEMPLATE := /etc/systemd/system/mscs@.service
|
||||||
MSCS_COMPLETION := /etc/bash_completion.d/mscs
|
MSCS_COMPLETION := /etc/bash_completion.d/mscs
|
||||||
|
|
||||||
UPDATE_D := $(wildcard update.d/*)
|
UPDATE_D := $(wildcard update.d/*)
|
||||||
@ -28,6 +29,7 @@ update:
|
|||||||
install -m 0644 mscs.completion $(MSCS_COMPLETION)
|
install -m 0644 mscs.completion $(MSCS_COMPLETION)
|
||||||
if which systemctl; then \
|
if which systemctl; then \
|
||||||
install -m 0644 mscs.service $(MSCS_SERVICE); \
|
install -m 0644 mscs.service $(MSCS_SERVICE); \
|
||||||
|
install -m 0644 mscs@.service $(MSCS_SERVICE_TEMPLATE); \
|
||||||
fi
|
fi
|
||||||
@for script in $(UPDATE_D); do \
|
@for script in $(UPDATE_D); do \
|
||||||
sh $$script; \
|
sh $$script; \
|
||||||
@ -36,7 +38,7 @@ update:
|
|||||||
clean:
|
clean:
|
||||||
if which systemctl; then \
|
if which systemctl; then \
|
||||||
systemctl -f disable mscs.service; \
|
systemctl -f disable mscs.service; \
|
||||||
rm -f $(MSCS_SERVICE); \
|
rm -f $(MSCS_SERVICE) $(MSCS_SERVICE_TEMPLATE); \
|
||||||
else \
|
else \
|
||||||
update-rc.d mscs remove; \
|
update-rc.d mscs remove; \
|
||||||
rm -f $(MSCS_INIT_D); \
|
rm -f $(MSCS_INIT_D); \
|
||||||
|
18
mscs@.service
Normal file
18
mscs@.service
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Minecraft Server Control Script for server %i
|
||||||
|
Documentation=https://github.com/MinecraftServerControl/mscs
|
||||||
|
Requires=network.target
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=minecraft
|
||||||
|
Group=minecraft
|
||||||
|
Environment="PATH=/usr/local/bin:/usr/bin:/bin"
|
||||||
|
ExecStart=/usr/local/bin/mscs start %i
|
||||||
|
ExecStop=/usr/local/bin/mscs stop %i
|
||||||
|
ExecReload=/usr/local/bin/mscs restart %i
|
||||||
|
Type=oneshot
|
||||||
|
RemainAfterExit=yes
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
Loading…
Reference in New Issue
Block a user