]> Frank Brehm's Git Trees - config/sarah/etc.git/commitdiff
daily autocommit
authorFrank Brehm <frank@brehm-online.com>
Thu, 28 Mar 2019 05:42:51 +0000 (06:42 +0100)
committerFrank Brehm <frank@brehm-online.com>
Thu, 28 Mar 2019 05:42:51 +0000 (06:42 +0100)
.etckeeper
systemd/system/minecraft.service [new file with mode: 0644]
systemd/system/multi-user.target.wants/minecraft.service [new symlink]

index ef71f76ce5298f3532b12b0884fd115fd26d0020..1c4b788e4b3bf11c68d13a5ce41ca82d66ffa782 100755 (executable)
@@ -1449,6 +1449,7 @@ maybe chmod 0755 'systemd/system/default.target.wants'
 maybe chmod 0755 'systemd/system/getty.target.wants'
 maybe chmod 0755 'systemd/system/getty@tty1.service.d'
 maybe chmod 0644 'systemd/system/getty@tty1.service.d/noclear.conf'
+maybe chmod 0644 'systemd/system/minecraft.service'
 maybe chmod 0755 'systemd/system/multi-user.target.wants'
 maybe chmod 0755 'systemd/system/network-online.target.wants'
 maybe chmod 0755 'systemd/system/paths.target.wants'
diff --git a/systemd/system/minecraft.service b/systemd/system/minecraft.service
new file mode 100644 (file)
index 0000000..4802b65
--- /dev/null
@@ -0,0 +1,37 @@
+[Unit]
+Description=Minecraft Server
+Documentation=
+
+Wants=network.target
+After=network.target
+
+[Service]
+WorkingDirectory=/home/minecraft/server
+# Users Database is not available for within the unit, only root and minecraft is available, everybody else is nobody
+PrivateUsers=true
+User=minecraft
+Group=users
+
+#ProtectHome=true
+#ProtectSystem=full
+# /proc/sys, /sys, /proc/sysrq-trigger, /proc/latency_stats, /proc/acpi, /proc/timer_stats, /proc/fs and /proc/irq will be read-only within the unit. It is recommended to turn this on for most services.
+ProtectKernelTunables=true
+# Block module system calls, also /usr/lib/modules. It is recommended to turn this on for most services that do not need special file systems or extra kernel modules to work
+ProtectKernelModules=true
+ProtectControlGroups=true
+
+Nice=5
+EnvironmentFile=-/home/minecraft/unit.conf
+KillMode=none
+SuccessExitStatus=0 1
+
+#PrivateDevices=true
+#NoNewPrivileges=true
+#PrivateTmp=true
+#InaccessibleDirectories=/root /sys /srv -/opt /media -/lost+found
+#ReadWriteDirectories=/home/minecraft/server
+ExecStart=/usr/bin/java -Xmx1024M -Xms1024M -jar spigot.jar --noconsole
+ExecStop=/home/minecraft/bin/mcrcon -H localhost -P 25575 -p "Shit5ahT-ai7" stop
+
+[Install]
+WantedBy=multi-user.target
diff --git a/systemd/system/multi-user.target.wants/minecraft.service b/systemd/system/multi-user.target.wants/minecraft.service
new file mode 120000 (symlink)
index 0000000..1c59e00
--- /dev/null
@@ -0,0 +1 @@
+/etc/systemd/system/minecraft.service
\ No newline at end of file