How to quit VRS safely? (clean shutdown)

Bug reports and questions about running Virtual Radar Server on Linux
Post Reply
Datamix
Posts: 57
Joined: Thu Aug 10, 2017 7:36 pm

How to quit VRS safely? (clean shutdown)

Post by Datamix » Fri Mar 30, 2018 10:52 am

Hey
I am running on raspbian (through mono) and I have a cron starting vrs @reboot.

Now I want a script that closes VRS safely (like "Press Q to quit" --> clean shutdown) to prevent database inconsistency.

Any ideas?
VRS: v3 (30-SEP-2018)

agw
Posts: 2130
Joined: Fri Feb 17, 2012 3:20 am

Re: How to quit VRS safely? (clean shutdown)

Post by agw » Sun Apr 01, 2018 1:15 am

VRS will shut down cleanly when you send it a SIGINT (e.g. kill -INT <PID> where <PID> is the process ID you squirreled away when you started the process).

Datamix
Posts: 57
Joined: Thu Aug 10, 2017 7:36 pm

Re: How to quit VRS safely? (clean shutdown)

Post by Datamix » Tue Apr 10, 2018 7:14 am

All clear - thank you!
VRS: v3 (30-SEP-2018)

gregw916
Posts: 16
Joined: Sat Feb 06, 2016 11:18 pm
Location: Minnesota, USA

Re: How to quit VRS safely? (clean shutdown)

Post by gregw916 » Sun May 20, 2018 4:01 pm

Great question. I was just looking for a way to do the same thing.

At the end of each month, I run a cron job to clean up the DB using SQlite, and strip off flight entries older than 150 days. This keeps the DB from getting huge. I'm pretty sure I've corrupted the DB by performing this task without shutting down VRS. Looks like now I've got a way to do this. Fortunately I have known good backups that have helped me in the past.

BUT..the PID of VRS is different every time it starts, so how can you specify VRS to be assigned to a known PID? Is that possible? I can't "Kill" a job whose PID I don't know. Or can I specify the application name itself?

Nevermind
Posts: 28
Joined: Thu Sep 11, 2014 12:36 am

Re: How to quit VRS safely? (clean shutdown)

Post by Nevermind » Tue May 22, 2018 7:38 am

Try

Code: Select all

kill -INT `pidof mono`
:)

Datamix
Posts: 57
Joined: Thu Aug 10, 2017 7:36 pm

Re: How to quit VRS safely? (clean shutdown)

Post by Datamix » Tue May 22, 2018 9:22 am

gregw916 wrote:
Sun May 20, 2018 4:01 pm
...
BUT..the PID of VRS is different every time it starts, so how can you specify VRS to be assigned to a known PID? Is that possible? I can't "Kill" a job whose PID I don't know. Or can I specify the application name itself?
You can create a sh-file with the following content:

Code: Select all

#!/bin/sh

kill -int $(pidof mono)
VRS: v3 (30-SEP-2018)

gregw916
Posts: 16
Joined: Sat Feb 06, 2016 11:18 pm
Location: Minnesota, USA

Re: How to quit VRS safely? (clean shutdown)

Post by gregw916 » Mon Jun 04, 2018 2:20 am

Thanks! That worked. I've now got it integrated into a script that runs as a cron job.

Post Reply