From: Frank Brehm Date: Sun, 5 May 2019 04:33:26 +0000 (+0200) Subject: daily autocommit X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=cee345fb7d6b876749cfc191dfad4a2203d3a102;p=config%2Fsarah%2Fetc.git daily autocommit --- diff --git a/.etckeeper b/.etckeeper index 663501d..86197fd 100755 --- a/.etckeeper +++ b/.etckeeper @@ -1443,6 +1443,7 @@ maybe chmod 0644 'systemd/network/99-default.link' maybe chmod 0644 'systemd/resolved.conf' maybe chmod 0755 'systemd/system' maybe chmod 0644 'systemd/system.conf' +maybe chmod 0755 'systemd/system/.old' maybe chmod 0755 'systemd/system/clamav-daemon.service.d' maybe chmod 0644 'systemd/system/clamav-daemon.service.d/extend.conf' maybe chmod 0755 'systemd/system/default.target.wants' @@ -1450,7 +1451,7 @@ 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/local.service' -maybe chmod 0644 'systemd/system/minecraft.service' +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 deleted file mode 100644 index 4802b65..0000000 --- a/systemd/system/minecraft.service +++ /dev/null @@ -1,37 +0,0 @@ -[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/minecraft@.service b/systemd/system/minecraft@.service new file mode 100644 index 0000000..fca0ff2 --- /dev/null +++ b/systemd/system/minecraft@.service @@ -0,0 +1,25 @@ +[Unit] +Description=Minecraft Server: %i + +Wants=network.target +After=network.target + +[Service] +WorkingDirectory=/home/minecraft/%i + +PrivateUsers=true +User=minecraft +Group=minecraft + +Restart=always + +ExecStart=/usr/bin/screen -DmS mc-%i /usr/bin/java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui + +ExecStop=/usr/bin/screen -p 0 -S mc-%i -X eval 'stuff "say SERVER SHUTTING DOWN IN 5 SECONDS. SAVING ALL MAPS..."\015' +ExecStop=/bin/sleep 5 +ExecStop=/usr/bin/screen -p 0 -S mc-%i -X eval 'stuff "save-all"\015' +ExecStop=/usr/bin/screen -p 0 -S mc-%i -X eval 'stuff "stop"\015' + + +[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 deleted file mode 120000 index 1c59e00..0000000 --- a/systemd/system/multi-user.target.wants/minecraft.service +++ /dev/null @@ -1 +0,0 @@ -/etc/systemd/system/minecraft.service \ No newline at end of file