I'm using a remote linux server at Contabo. I have no problem to start the server and connect to it via editor or client. But I want to run the server as a service so it can restart automatically if anything happens. The problem is that the server restarts infinitely. I've tried several approaches including a wrapper. This is my service file.
[Unit]
Description=Intersect Game Server
After=network.target
[Service]
Type=simple
User=XYZ
Group=XYZ
WorkingDirectory=/home/XYZ/Intersect/Server
ExecStart=/home/XYZ/Intersect/Server/IntersectServer
Restart=always
RestartSec=10
# Allow input (required for Intersect's console)
StandardInput=tty
TTYPath=/dev/console
# Logging
StandardOutput=journal
StandardError=journal
# DataProtection directory
Environment=ASPNETCORE_DATA_PROTECTION_DIRECTORY=/var/aspnet/DataProtection-Keys
[Install]
WantedBy=multi-user.target