Page 1 of 1

How to quit VRS safely? (clean shutdown)

Posted: Fri Mar 30, 2018 10:52 am
by Datamix
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?

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

Posted: Sun Apr 01, 2018 1:15 am
by agw
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).

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

Posted: Tue Apr 10, 2018 7:14 am
by Datamix
All clear - thank you!

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

Posted: Sun May 20, 2018 4:01 pm
by gregw916
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?

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

Posted: Tue May 22, 2018 7:38 am
by Nevermind
Try

Code: Select all

kill -INT `pidof mono`
:)

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

Posted: Tue May 22, 2018 9:22 am
by Datamix
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)

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

Posted: Mon Jun 04, 2018 2:20 am
by gregw916
Thanks! That worked. I've now got it integrated into a script that runs as a cron job.