papermc/templates/papermc.service.j2
author Luke Hoersten <luke@hoersten.org>
Mon, 29 Jun 2020 18:38:49 -0500
changeset 56 59e94b4a91a2
parent 33 ad75fc2d2853
child 108 f00f45a9512d
permissions -rw-r--r--
Added mercurial web hosting
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
19
31de177274a1 Added minecraft server role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     1
[Unit]
33
ad75fc2d2853 Added papermc role.
Luke Hoersten <luke@hoersten.org>
parents: 19
diff changeset
     2
Description=PaperMC Server
ad75fc2d2853 Added papermc role.
Luke Hoersten <luke@hoersten.org>
parents: 19
diff changeset
     3
Documentation=https://paper.readthedocs.io/en/latest/server/getting-started.html
19
31de177274a1 Added minecraft server role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     4
31de177274a1 Added minecraft server role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     5
Wants=network.target
31de177274a1 Added minecraft server role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     6
After=network.target
31de177274a1 Added minecraft server role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     7
31de177274a1 Added minecraft server role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     8
[Service]
33
ad75fc2d2853 Added papermc role.
Luke Hoersten <luke@hoersten.org>
parents: 19
diff changeset
     9
User={{papermc_user}}
ad75fc2d2853 Added papermc role.
Luke Hoersten <luke@hoersten.org>
parents: 19
diff changeset
    10
Group={{papermc_user}}
ad75fc2d2853 Added papermc role.
Luke Hoersten <luke@hoersten.org>
parents: 19
diff changeset
    11
WorkingDirectory={{papermc_dir}}
19
31de177274a1 Added minecraft server role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    12
Restart=on-failure
31de177274a1 Added minecraft server role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    13
RestartSec=20 5
33
ad75fc2d2853 Added papermc role.
Luke Hoersten <luke@hoersten.org>
parents: 19
diff changeset
    14
ExecStart=/usr/bin/java -Xms{{papermc_mem}} -Xmx{{papermc_mem}} -jar server.jar
19
31de177274a1 Added minecraft server role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    15
31de177274a1 Added minecraft server role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    16
PrivateTmp=true
31de177274a1 Added minecraft server role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    17
ProtectSystem=full
31de177274a1 Added minecraft server role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    18
NoNewPrivileges=true
31de177274a1 Added minecraft server role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    19
PrivateDevices=true
31de177274a1 Added minecraft server role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    20
31de177274a1 Added minecraft server role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    21
[Install]
31de177274a1 Added minecraft server role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    22
WantedBy=multi-user.target