Jump to content
  • 0

Runnung the server as a service.


Markdelaar

Question

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

 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...