[Unit] Description=AgentDVR [Service] WorkingDirectory=AGENT_LOCATION ExecStart=AGENT_LOCATION/Agent # fix memory management issue with dotnet core Environment="MALLOC_TRIM_THRESHOLD_=100000" # to query logs using journalctl, set a logical name here SyslogIdentifier=AgentDVR User=YOUR_USERNAME # ensure the service automatically restarts Restart=always # amount of time to wait before restarting the service RestartSec=5 [Install] WantedBy=multi-user.target