[Unit]
# Implicit needs are explicitly needed to survive shutdown till stop finishes
After=network.target
BindsTo=mcbe.socket
Description=Minecraft Bedrock Edition Server

[Service]
ExecStart=/bin/bash -c "LD_LIBRARY_PATH=. ./bedrock_server"
ExecStop=-/bin/bash -c "echo stop > /run/mcb"
ExecReload=/bin/bash -c "echo reload > /run/mcb"
SuccessExitStatus=1
User=mcadmin
WorkingDirectory=/home/mcadmin
Restart=on-failure
StandardInput=socket
StandardOutput=journal
StandardError=journal
Type=simple
# Thanks for the security agowa338
PrivateUsers=true
ProtectHome=true
ProtectControlGroups=true
ProtectKernelModules=true
ProtectKernelTunables=true
ProtectSystem=full

[Install]
WantedBy=multi-user.target