Page 1 of 2

Keep VRS running after closing telnet session

Posted: Fri Dec 23, 2016 2:55 am
by peteclyde
Hey all,

I've got VRS running on my Pi3 - to get it started I telnet / ssh into the Pi, and run

Code: Select all

mono VirtualRadar.exe -nogui
I've got no troubles access the web interface, as well as the admin section.

However, when I either hit the Q button in the ssh session, or close Putty, the program stops. I've tried ctrl-x and trying to make it a foreground job to no avail.

I'm sure there's an easy way to do it but a search of the forums hasn't helped me as yet.

I even tried setting it to load on boot but even then I'm not having any luck.

Any help appreciated.

Pete

Re: Keep VRS running after closing telnet session

Posted: Mon Dec 26, 2016 10:36 pm
by peteclyde
OK, got it sorted, not sure if it's the best way but it works.

Installed tmux on my Raspberry pi

Code: Select all

pi@raspberrypi:~ $ sudo apt-get install tmux
Started tmux

Code: Select all

pi@raspberrypi:~ $ tmux
Inside the tmux terminal I started VRS

Code: Select all

mono /home/pi/vrs/VirtualRadar.exe -nogui
Then to exit tmux, but leave VRS running, I did Ctrl+b then d

Seems to work fine and resolved my issue.

Re: Keep VRS running after closing telnet session

Posted: Tue Dec 27, 2016 10:38 am
by argz
I'm sure there's an easy way to do it
You can just do

Code: Select all

mono /home/pi/vrs/VirtualRadar.exe -nogui &
Pleace notice & symbol in the end of the command.

This will force mono to run in the background.
I even tried setting it to load on boot
You should use Cron.
1. Create in the home directory file vrs.sh with the following text:

Code: Select all

#!/bin/sh
mono /home/pi/vrs/VirtualRadar.exe -nogui
2. Make sure the script is executable

Code: Select all

chmod +x  /home/pi/vrs.sh
3. Open crontab editor

Code: Select all

crontab -e
4. Add this code

Code: Select all

@reboot  /home/pi/vrs.sh
5. Close editor (do not forget to save)
6. Check jobs

Code: Select all

crontab -l
7. Reboot your RPi
8. Enjoy!

Re: Keep VRS running after closing telnet session

Posted: Wed Dec 28, 2016 5:33 am
by peteclyde
Hey Argz,

The first option

Code: Select all

mono /home/pi/vrs/VirtualRadar.exe -nogui &
didn't work, but the second one works fine.

Code: Select all

#!/bin/sh
mono /home/pi/vrs/VirtualRadar.exe -nogui
chmod +x  /home/pi/vrs.sh
crontab -e
@reboot  /home/pi/vrs.sh
Thanks heaps,

Pete

Re: Keep VRS running after closing telnet session

Posted: Wed Dec 28, 2016 10:23 am
by argz
peteclyde wrote:The first option

Code: Select all

mono /home/pi/vrs/VirtualRadar.exe -nogui &
didn't work,
Could you post here a terminal output after this command?

Re: Keep VRS running after closing telnet session

Posted: Thu Dec 29, 2016 4:52 am
by peteclyde
Hi

It just started the program as if the & wasn't there.... like the & had no effect.

PM

Re: Keep VRS running after closing telnet session

Posted: Thu Dec 29, 2016 8:22 am
by argz
peteclyde wrote: like the & had no effect
After you run

Code: Select all

mono /home/pi/vrs/VirtualRadar.exe -nogui &
press enter. After that you should be able to run new commands.

Re: Keep VRS running after closing telnet session

Posted: Thu Dec 29, 2016 9:32 am
by peteclyde
Program stops when I start it with &

Code: Select all

pi@raspberrypi:~ $ mono /home/pi/vrs/VirtualRadar.exe -nogui &
[1] 1238
pi@raspberrypi:~ $ Parsing command-line parameters
Initialising the log
Initialising user manager
Loading the configuration
Starting picture folder cache
Opening the BaseStation database
Loading standing data
Initialising air pressure manager
Connecting to data feed
Starting web server
Starting rebroadcast servers
Initialising UPnP manager
Connecting server to Internet via UPnP
Initialising online lookup manager
Starting plugins
Local address: http://127.0.0.1:8080/VirtualRadar
Network address: http://192.168.1.229:8080/VirtualRadar
Press Q to quit


[1]+  Stopped                 mono /home/pi/vrs/VirtualRadar.exe -nogui

Re: Keep VRS running after closing telnet session

Posted: Thu Dec 29, 2016 9:50 pm
by argz
Try this maybe:

Code: Select all

mono /home/pi/vrs/VirtualRadar.exe -nogui &>/dev/null

Re: Keep VRS running after closing telnet session

Posted: Thu Jan 18, 2018 7:30 pm
by scoobydobedooo
hey,
probs to late now but i had the same issue, i fixed it by installing screen to the linux system.

i then open the server throw putty and type screen then enter.

then i run the the vrs then once open i press ctrl a and d and theis puts vrs into screen mode which then allows you to access other stuff on the server or allows you to close out of the server complete allowing vrs to still run :)

ben