Subject: Re: distributed address book

From: [email-masked] (Jack Churchill)
Date: Thu, 17 Jun 1993 17:45:43 EST

>Why does pine remove (unlink) the address book before writing back the new
>entries?  Can't it just overwrite the existing file?  The reason I ask and
>as mentioned in the doc, the remove destroys any special protection and
>symbolic link.  I like to use the latter to distribute the address books for
>some users across various workstations.

I think I've found the solution.  I simply added/modifed the following
lines marked with a ++ in pine.c

    /* Must do this here, so we can get the .pinerc file and debug file */
++  if(getenv("PINEHOME") != NULL) { 
++      pine_state->home_dir = cpystr(getenv("PINEHOME"));
++  } else if(getenv("HOME") != NULL) { 
        pine_state->home_dir = cpystr(getenv("HOME"));
    } else if(get_system_homedir() != NULL) {
        pine_state->home_dir = cpystr(get_system_homedir());
    } else {
        pine_state->home_dir = cpystr("");
    }

and setenv PINEHOME in the user's login file (e.g., setenv PINEHOME
/mountpoint/$USER).  Is this a bad thing?  That way everything (almost -
not including the pine.info and pine.conf) is in the one place.  Before,
I was linking each mail subdirectory to the main server but now I don't
need to do this.  Yes, I know the possible problems associated with NFS
sharing the files but I've minimised the risk by using appropriate
options with the mount command.  Enabling file locking is next on my "to
do" list but I haven't seen any problems yet.

  Jack N. Churchill                         | [email-masked]
  CSIRO  Division of Exploration Geoscience | [email-masked]
  PO Box 136  North Ryde  NSW  2113         | Phone:  +61 2 887 8884
  Australia                                 | Fax:    +61 2 887 8909

---

From: Laurence Lundblade <[email-masked]>
Date: Thu, 17 Jun 1993 09:27:38 -0700 (PDT)

Hello Jack,

The reason Pine writes the address book to a temp file, removes the
original and renames the new one is to be sure the writing of the new
address book is complete before destroying the old one. 

I think you're scheme will work OK.  The main place to have locking is on
the inbox where there's contention all the time (new mail arriving). Some
of the Pine locking won't work across NFS (detecting another Pine has it
open), but the most basic locking (mail file consistency) will work unless
conditions are extreme. For example if you network is dropping NFS packets
the basic locking can fail. 

LL