vradarserver / vrs

A .NET web server that can plot the positions of aircraft on a map
http://www.virtualradarserver.co.uk/
Other
267 stars 50 forks source link

Mono-Documentation: Document how VRS can be run as system service. #103

Open robbyb67 opened 1 year ago

robbyb67 commented 1 year ago

I think many users - especially in the Linux domain - want to run the vr server as a system service/daemon. This can be achieved by creating a file /etc/systemd/system/virtualradar.service with the following content:

[Unit]
Description=Virtual Radar Server ADS-B Plotter
Wants=network.target
After=syslog.target network-online.target

[Service]
Type=simple
ExecStart=/usr/bin/mono <absolute Path>/VirtualRadar/VirtualRadar.exe -nogui
Restart=on-failure
RestartSec=10
KillMode=process
User=<vrs-user>
Group=<vrs-group>

[Install]
WantedBy=multi-user.target

The , and has of cause to be replaced by installation specific values.

Call sudo systemctl daemon-reload to let systemd get aware of the new file. You can now start / stop VRS by issuing sudo service virtualradar start/stop, sudo service virtualradar status shows thew current status of the server including the last lines logged to console.

To enable automatic start of the service at system startup: sudo systemctl enable virtualradar

FrogCF commented 1 year ago

Debian 10/11

[Service] Type=simple ExecStart=/usr/bin/mono /VirtualRadar/VirtualRadar.exe -nogui Restart=on-failure RestartSec=5 KillMode=process User=root Group=root

[Install] WantedBy=multi-user. Target