summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDavid Härdeman <david@hardeman.nu>2020-07-11 18:07:27 +0200
committerDavid Härdeman <david@hardeman.nu>2020-07-11 18:07:27 +0200
commite6fdfd4c4c753fe3a06edc4ae3b767c57c10d3f7 (patch)
tree9d75b0009acc15cb5ed085f968a24b221266b44e /examples
parent3dc8d84af1753b41fe37b3b3954731379dc579aa (diff)
Flesh out the new command a bit more
Diffstat (limited to 'examples')
-rw-r--r--examples/minecserver@.service37
-rw-r--r--examples/server.properties10
2 files changed, 45 insertions, 2 deletions
diff --git a/examples/minecserver@.service b/examples/minecserver@.service
index e14ed81..bb72c5b 100644
--- a/examples/minecserver@.service
+++ b/examples/minecserver@.service
@@ -1 +1,36 @@
-This is an example service
+[Unit]
+Description=Minecraft Server %i
+#Documentation= https://url https://url man:abc
+Wants=network-online.target
+After=network-online.target
+ConditionFileNotEmpty=%E/minecproxy/config/%i.mcserver
+ConditionPathExists=%E/minecproxy/servers/%i/eula.txt
+ConditionPathExists=%E/minecproxy/servers/%i/server.properties
+ConditionPathExists=%E/minecproxy/servers/%i/server.jar
+
+[Service]
+Type=exec
+ExecStart=/usr/bin/java -Xmx1024M -Xms1024M -jar server.jar --nogui
+ExecStop=-/usr/bin/minecctl -c %E/minecproxy/config/ -f stop %i
+# Optional: this will autogenerate new servers on the fly
+# if this is used, comment out the ConditionPathExists checks above
+#ExecStartPre=/usr/bin/minecctl new %i
+TimeoutStopSec=120
+KillSignal=SIGCONT
+Restart=on-failure
+WorkingDirectory=%E/minecproxy/servers/%i
+Nice=5
+LimitCORE=0
+NoNewPrivileges=true
+KeyringMode=private
+PrivateUsers=true
+ProtectSystem=strict
+ReadWritePaths=%E/minecproxy/servers/%i
+PrivateDevices=true
+ProtectKernelTunables=true
+ProtectControlGroups=true
+RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
+RestrictNamespaces=true
+LockPersonality=true
+RestrictSUIDSGID=true
+PrivateTmp=true
diff --git a/examples/server.properties b/examples/server.properties
index f992c40..dddb380 100644
--- a/examples/server.properties
+++ b/examples/server.properties
@@ -1 +1,9 @@
-This is an example server.properties file
+#Minecraft server properties
+# This is a partial file, it will be replaced with a
+# fleshed out version the first time the Minecraft
+# server is executed.
+motd=A Minecraft Server
+server-port=25565
+enable-rcon=true
+rcon.port=25575
+rcon.password=secret