From a453d785f5d124bdba4b16bba9131e873295fa46 Mon Sep 17 00:00:00 2001 From: EliasSchriefer Date: Sun, 30 Aug 2020 17:38:49 +0200 Subject: [PATCH] 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) --- Makefile | 19 +++++++++++++++++++ sfsmcd/org.ddnss.sfs.mc.conf | 12 ++++++++++++ sfsmcd/sfsmc-debug@.service | 9 +++++++++ 3 files changed, 40 insertions(+) create mode 100644 Makefile create mode 100644 sfsmcd/org.ddnss.sfs.mc.conf create mode 100644 sfsmcd/sfsmc-debug@.service diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e101f0b --- /dev/null +++ b/Makefile @@ -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 \ No newline at end of file diff --git a/sfsmcd/org.ddnss.sfs.mc.conf b/sfsmcd/org.ddnss.sfs.mc.conf new file mode 100644 index 0000000..917501f --- /dev/null +++ b/sfsmcd/org.ddnss.sfs.mc.conf @@ -0,0 +1,12 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/sfsmcd/sfsmc-debug@.service b/sfsmcd/sfsmc-debug@.service new file mode 100644 index 0000000..808c033 --- /dev/null +++ b/sfsmcd/sfsmc-debug@.service @@ -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 \ No newline at end of file