Installing and feeding VRS on headless Linux VPS

Tried to disable MLAT, it’s still crashing. So something else is going on.

Seems like mono is the culprit;
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.

EDIT: Will reformat the Pi later today, i’m quite fast at it now… I saved a notepadfile with all commands…
And then make an image before installing VRS! :smiley:

Taking an image takes longer than reinstall, if you are using it for feeding only.
:wink:

Strange behavior with your VRS installation.
Which Mono-Version are you using? Do you run it as a service with root permissions?

Very unlikely but it can be a damaged SD card or file system

OK, deleted the extra recievers from the Pi3, now it has been running since ~6 in the morning :thinking:

Btw. Isn’t there any way for VRS to start at boot… Now I use tmux, detach, and closing putty after a reboot.

 

In my opinion, instead of using cron, it is more flexible to use systemd service. The systemd will start vrsfeed at boot. You can also use following commands to manually start, restart, stop, & check status.

sudo systemctl start|restart|stop|status vresfeed

This is how systemd service can be created for vrsfeed:

(1) After you have created and made executable the file vrsfeed.sh, do not move it to /usr/local/bin, and do not create a cron job for it.

Instead create directory /usr/share/vrsfeed and move file vrsfeed.sh into it, then create vrsfeed.service file as detailed below:

$ sudo mkdir /usr/share/vrsfeed   
$ sudo mv vrsfeed /usr/share/vrsfeed

 
(2) Create Service file vrsfeed.service

$ sudo nano /lib/systemd/system/vrsfeed.service 

 
(3) Copy-paste following in the blank file vrsfeed.service

# vrsfeed service for systemd
[Unit]
Description=vrsfeed
Wants=network.target
After=network.target
[Service]
RuntimeDirectory=vrsfeed
RuntimeDirectoryMode=0755
ExecStart=/usr/share/vrsfeed/vrsfeed
SyslogIdentifier=vrsfeed
Type=simple
Restart=on-failure
RestartSec=30
RestartPreventExitStatus=64
Nice=-5
[Install]
WantedBy=default.target

 
(4) Enable the vrsfeed service, start and check its status.

$ sudo systemctl enable vrsfeed   

$ sudo systemctl start vrsfeed  

$ sudo systemctl status vrsfeed  

Now the vrsfeed will automatically start at boot, and you can start, stop & check its status by systemd commands noted above. :slight_smile:

 

 

1 Like

Great! Just what I needed - Can these settings be applied to an existing system (installed by the steps in this thread), without disturbing the cron task, or other things?

You cannot use cron and systemd simultaneously, it can cause complications. You can stop vrsfeed to be started by cron if you comment out the line you have added in crontab,

Here are the steps if you have already created cron job:

(1) Open crontab.

$ crontab -e

(2) Comment-out this line (which you have added) by putting a # at its start:
*/5 * * * * /usr/local/bin/vrsfeed &> /dev/null

It will become
#*/5 * * * * /usr/local/bin/vrsfeed &> /dev/null

 
(3) Do not follow step (1) of my previous post.
Instead follow steps (2), (3), & (4) of my previous post, but in the service file, replace following line

ExecStart=/usr/share/vrsfeed/vrsfeed

By

ExecStart=/usr/local/bin/vrsfeed

1 Like

Just tested, something seems wrong?

pi@raspberrypi:~ $ sudo systemctl status vrsfeed
● vrsfeed.service - vrsfeed
   Loaded: loaded (/lib/systemd/system/vrsfeed.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Tue 2020-06-02 20:06:16 BST; 5s ago
  Process: 792 ExecStart=/usr/share/vrsfeed/vrsfeed (code=exited, status=203/EXEC)
 Main PID: 792 (code=exited, status=203/EXEC)
pi@raspberrypi:~ $

EDIT: For some reason, step 3 in your latest reply did not get saved…

● vrsfeed.service - vrsfeed
   Loaded: loaded (/lib/systemd/system/vrsfeed.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Tue 2020-06-02 20:10:35 BST; 4s ago
  Process: 778 ExecStart=/usr/local/bin/vrsfeed (code=exited, status=0/SUCCESS)
 Main PID: 778 (code=exited, status=0/SUCCESS)

Jun 02 20:10:35 raspberrypi systemd[1]: Started vrsfeed.
Jun 02 20:10:35 raspberrypi systemd[1]: vrsfeed.service: Succeeded.
pi@raspberrypi:~ $

The webinterface isn’t online though…

Just in case you want to revert to cron, do this

(1) Disable systemd service

sudo systemctl stop vrsfeed

sudo systemctl disable vrsfeed  

(2) Re-enable cron

$ crontab -e 

Scroll down to line:
#*/5 * * * * /usr/local/bin/vrsfeed &> /dev/null

Remove # from its start so it becomes:
*/5 * * * * /usr/local/bin/vrsfeed &> /dev/null

 
(3) Reboot PI so that vrsfeed is started by cron

 

My big fingers :sweat_smile:

However, it seems to work - But the webinterface should start at boot, right?

YES :slight_smile:

Reboot and check.

Edit:
The vrsfeed service only starts the data connection between your Pi and VRS running at VPS. It does not start the VRS itself or any web interface.

 
 

So, after @foxhunter learned me a thing or two about VRS; no need to use socat + crontab, or other services.
Make a reciever @127.0.0.1:30005 RAW. VRS is able to decode it self. Makes thing more simple for a newb as me.

there is a need for socat if you want to feed to a remote VRS (or any other network supporting that). This can be done in two ways:

  • open your local network that the remote VRS can scrape the data
  • use socat to push the data to that server

The first one requires that you open a port in your local router/firewall and the usage of a DynDNS adress. Otherwise the connection will be lost on every IP change with your provider.
The second one give the option to push to a server without opening up your local network.

Third option would be the rebroadcasting feature in VRS. For this of course you need to run an instance locally.

While i don’t disagree, this thread is about a local installation…

Right, sometimes i forget the purpose of a thread. Sorry … :frowning:

I think there is some misunderstanding. The very first post of this thread starts with:

“This is a tutorial for installing Virtual Radar Server (VRS) on a Virtual Private Server (VPS)”

1 Like