Multi-user gnucash

ghaverla@freenet.edmonton.ab.ca ghaverla@freenet.edmonton.ab.ca
Fri, 23 Mar 2001 11:42:50 -0700 (MST)


On Fri, 23 Mar 2001 linas@linas.org wrote:

> It's been rumoured that Rich Shepard said:
> >        We use (or try to, at least) gnucash for personal finance.
> > But, rather than having both of us work on one machine, my wife invoked
> > gnucash from her networked workstation by telnet'ing to the workstation on
> > which the software is installed.

I am guessing that the data files are in in the home directory
of some user (for arguments purposes, rich).  So, you'll have
files like:
 /home/rich/personal.xac
 /home/rich/personal.1234567890123.LCK
etc.  When user "rich" logs in, $HOME will be set to /home/rich
(hence that first file is also known as $HOME/personal.xac) and
for shells like bash ~/ will be the same as /home/rich/

Is your wife logging in via telnet as rich, or is she logging
in as "wife", and is relying on directory/file permissions
to allow her to read/write the various files in your (/home/rich)
directory?

> >                     When we clear the LCK and LNK files from
> > the shared data directory, it runs just fine. But, when she exits the
> > program (or, when I exit the program if I'm running it from a networked
> > box), the LNK and LCK files are not removed.
>
> How do you exit gnucash?  Do you use the main gnucash
> pulldown menu and select "exit" from that menu?  Or do you use the
> window manager to close the main gnucash window?
> 
> If its the latter, then I suspect that maybe the window manager isn't
> ICCCM compliant, and so gnucash doesn't receive the shutdown message...

GnuCash isn't trapping all (enough of) the signals?


As a group, the non-PC-OS people (like Linux) are getting
better at teaching people that we all actually "wear many
hats" (operate under different "personalities") when we use
PCs running Linux (or various versions of UNIX).  That
a person shouldn't be running as "root" (the all powerful
administrator ID) all the time.

But sometimes, we assume that we only wear two hats, when we 
probably should be wearing more than 2.  In this case, it
might actually help things a bit if your machine had a
pfinance ID, and when either of you had "personal"
(probably actually finances of you as a couple) finance
work to do, both of you would log in as pfinance to do
this work, and not do it as "rich" or "wife".

Does this solve the problem of leaving behind LCK/LNK files
if the program exits "improperly" over a network connection?
No.  A simple sort of thing which is not elegant, but should 
work would be something along the following:
 (Assumes gnucash is in /usr/local/bin)
 mv /usr/local/bin/gnucash /usr/local/bin/gnucash.bin
 edit /usr/local/bin/gnucash to contain
    #!/bin/sh
    /usr/local/bin/gnucash.bin
    mv $HOME/*LCK $HOME/trash >& /dev/null
    mv $HOME/*LNK $HOME/trash >& /dev/null
 chmod 755 /usr/local/bin/gnucash
 (Using a trash directory so that we don't accidentally delete
 something we don't want to.  Periodically we would need to
 clean this directory up.)
Other inelegant ways to get around this would include having
a cron job running, looking to delete these files if gnucash
wasn't running.

If something is killing GnuCash with a signal which isn't
being trapped, or can't be trapped; these files will be
left behind.  If the signal can be trapped, then Linas, Bill
and the other guys/gals at gnumatic will probably write the 
code to take care of this case.  If it is a case of a signal
which can't be trapped, then some other way around the problem
is needed.  Maybe the code in GnuCash which looks for the 
presence of these files can try to delete them if no other
instance of gnucash is running.  On a multi-user machine
there may legitimately be multiple instances running; one way
to differentiate one from another would be to overwrite the
$argv[0] string which gets displayed by programs such as 'ps'.

As far as having multiple binaries of GnuCash on a LAN, with
filesystems imported/exported via NFS is concerned, the only
real problems I am familiar with are:
- all the binaries are not the same version, and there is a
   change in file format between the various versions.
- not all of the machines on the LAN share the same binary
   formats for the types of data stored in the file.  Little
   endian versus big endian, and the various floating point
   formats are like this.


I don't know if the answer is in there (above text) or not.
Hopefully it helps.  I would rather not get involved in
fixing code, as I have a zillion other things to do.  Most
of my code writing is in FORTRAN, C, C++ and perl.  Looking
at LISP and LISP like languages gives me a headache.  :-)
But, if I need to do that to get back into good graces,
I should have some time available in the near future.

Have a good weekend.
Gord

Matter Realisations     http://www.materialisations.com/
Gordon Haverland, B.Sc. M.Eng. President
101  9504 182 St. NW    Edmonton, AB, CA  T5T 3A7
780/481-8019            ghaverla @ freenet.edmonton.ab.ca
780/993-1274 (cell)