Questions Regarding Backup and Stopping Gnucash
prl
prl at ozemail.com.au
Mon Sep 23 00:56:22 EDT 2013
As Buddha Buck suggested, using kill/killall (sending the default
SIGTERM) leaves the lock file in place, and so almost certainly would
leave any unsaved changes unsaved.
Putting a command into the shutdown script to remove the lock file(s)
would be relatively easy. Saving unsaved changes could only be fixed
inside GnuCash.
Peter
On 23/09/13 14:41, Mark Phillips wrote:
> I guess my question really is, will killing gnucash this way (ie the
> normal way to kill a program from the command line) create any issues
> with restarting the program. Or, will gnucash close down gracefully
> when it receives a kill command?
>
> Thanks,
>
> Mark
>
>
> On Sun, Sep 22, 2013 at 9:34 PM, prl <prl at ozemail.com.au
> <mailto:prl at ozemail.com.au>> wrote:
>
> killall gnucash
>
> Or, if you must do it the hard way:
>
> if ps ax | grep -q 'gnu\cash'; then kill `ps ax | awk '/gnu\cash/
> {print $1}'`; fi
>
> The '\' is a trick to stop the grep from matching itself in the ps
> output.
>
> The above won't work on OS X, because the running gnucash is
> called Gnucash-bin. Changing the matches to Gnu\cash-bin will
> probably work as desired on OS X.
>
> Similarly,
>
> killall Gnucash-bin
>
> Peter
>
>
> On 23/09/13 13:36, Buddha Buck wrote:
>
> The question is, once you have the pid of a running gnucash,
> what can you
> sensibly do with it?
>
> Right now, I'd say "nothing". Sending a SIGTERM may cause
> gnucash to quit,
> but probably leaving a lockfile and not saving any
> transactions since the
> last autosave. Sending SIGKILL will do likewise.
>
> What could be a sensible enhancement is to put in some signal
> handlers:
> SIGHUP to force an autosave (useful for preparation for
> late-night
> backups, the usecase that started this thread), SIGTERM to
> save-and-quit,
> etc.
>
> But arguably, GnuCash is not meant to be used that way, and
> the signal
> handlers would support an unsupported usecase. And may not be
> portable,
> either.
>
More information about the gnucash-user
mailing list