Automatic price quotes & PostgreSQL backend

Geert Janssens janssens-geert at telenet.be
Wed Nov 6 12:35:26 EST 2013


On Wednesday 06 November 2013 10:39:35 David wrote:
> OK, I added "pkill 'gnucash$';sleep 5" to my script, but still no
> prices.  I get this:
> 
> 
> 
> 
>  gnc.bin-Message: main: binreloc relocation support was disabled at
> configure time.
> 
> Found Finance::Quote version 1.17
> 
> 
> 
> 
> 
Killing gnucash doesn't seem like a good idea. Gnucash keeps a lock file 
around for the open data file. By killing gnucash this lock is not 
properly removed. For gnucash that is as if the file is still open. So 
for the price quote update code you are in the exact same situation as 
without killing gnucash.

This is also not what Matt suggested. He suggested to abort your attempt 
to update prices, not killing a running gnucash instance.

You may have to look for a way to cleanly shut down gnucash via 
scripting. Perhaps you can use the wmctrl command for this purpose (if 
you are in an X environment).

The call
wmctrl -c "- gnucash"
will ask the gnucash program to close gracefully. This will only work of 
course if you don't have any unsaved changes.
Note that any window that matches the exact string (case-insensitive) "- 
gnucash" will be closed, not only the gnucash application. You can run
wmctrl -l
to check if other windows would be affected in your typical working 
environment.

Geert


More information about the gnucash-user mailing list