Add systemd service unit file and D-Bus config
The unit file is only for debugging purposes. The Makefile is used to install (link --runtime), start, stop, and restart the service, and to see the output (journalctl)
This commit is contained in:
parent
41ca57898d
commit
a453d785f5
19
Makefile
Normal file
19
Makefile
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
install-debug:
|
||||||
|
@sudo systemctl --runtime link sfsmcd/sfsmc-debug@.service
|
||||||
|
.PHONY: install-debug
|
||||||
|
|
||||||
|
journalctl:
|
||||||
|
@journalctl -efSnow -usfsmc-debug@$$(cd ..; pwd) -ocat
|
||||||
|
.PHONY: journalctl
|
||||||
|
|
||||||
|
start:
|
||||||
|
@sudo systemctl start sfsmc-debug@$$(cd ..; pwd)
|
||||||
|
.PHONY: start
|
||||||
|
|
||||||
|
stop:
|
||||||
|
@sudo systemctl stop sfsmc-debug@$$(cd ..; pwd)
|
||||||
|
.PHONY: stop
|
||||||
|
|
||||||
|
restart:
|
||||||
|
@sudo systemctl restart sfsmc-debug@$$(cd ..; pwd)
|
||||||
|
.PHONY: restart
|
12
sfsmcd/org.ddnss.sfs.mc.conf
Normal file
12
sfsmcd/org.ddnss.sfs.mc.conf
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN"
|
||||||
|
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
|
||||||
|
<busconfig>
|
||||||
|
<policy user="root">
|
||||||
|
<allow own="org.ddnss.sfs.mc"/>
|
||||||
|
</policy>
|
||||||
|
|
||||||
|
<policy context="default">
|
||||||
|
<allow send_destination="org.ddnss.sfs.mc"/>
|
||||||
|
</policy>
|
||||||
|
</busconfig>
|
9
sfsmcd/sfsmc-debug@.service
Normal file
9
sfsmcd/sfsmc-debug@.service
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=SFS Minecraft server (Debug)
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=dbus
|
||||||
|
BusName=org.ddnss.sfs.mc
|
||||||
|
ExecStart=%I/sfs-mc/target/debug/sfsmcd
|
||||||
|
User=root
|
Loading…
Reference in New Issue
Block a user