[comp.sys.sgi] ELM on IRISES

c60244@ccfiris.aedc (Kenny McDonald) (02/27/91)

I traced my problem/error with filter from elm-2.3 to the following section
of ~/filter/lock.c which was not opening the lock file:

-------------------------------------------------------------------------------

>>         while ((ret = open(lockfile, O_WRONLY | O_CREAT | O_EXCL, 0444)) < 0 
>>                 && attempts++ < 10) {
>>         sleep(3);     /* wait three seconds each pass, okay?? */

-------------------------------------------------------------------------------

It was trying to open a file in /usr/mail/username.lock as you can see from the
following section of code taken from ~/filter/lock.c also.  I commented out
this file name and named the lock file /tmp/username.lock.  This seems to be
working now.  If anyone has any suggestions/comments on this please reply.

>>  
>>   char *
>>   mk_lockname(home, user)
>>   char *home, *user;
>>   {
>>           /** Create the proper name of the lock file for file_to_lock.
>>               Return lock_name for informational purposes.
>>            **/
>>  
>>   #ifdef XENIX
>>           /* lock is /tmp/[basename of file_to_lock].mlk */
>>           sprintf(lockfile, "/tmp/%.10s.mlk", user);
>>   #else
>>          /* lock is [file_to_lock].lock */
>>++          /*sprintf(lockfile, "%s%s.lock", home, user);*/
>>++          sprintf(lockfile, "/tmp/%s.lock", user);
>>   #endif
>>           return(lockfile);
>>   }
>>  


Thanks anyway.

  vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
  | Kenneth M. McDonald * OAO Corp * Arnold Engineering Development Center |
  |          MS 120 * Arnold AFS, TN 37389-9998 * (615) 454-3413           |
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  INTERNET:                                               OO   AA   OO
  @aedc-vax.af.mil:c60244@ccfiris.aedc                   O  O A  A O  O
                                                         O  O AAAA O  O
  LOCAL:                                                 O  O A  A O  O
  c60244@ccfiris                                          OO  A  A  OO
                                                        ________________
                                                                       /

silvert@cs.dal.ca (Bill Silvert) (02/27/91)

In article <5079@unlisys.in-berlin.de> rot@unlisys.in-berlin.de (Robert Rothe) writes:

[discussion about lock files]

>But why this ? is there no setgid() available, or doesn't it work ?

I've just installed ELM on a 4D/25 as well as on a Stardent, and there
seem to be lock problems.  Even though ELM runs sgid as mail and the
mail directory has the correct group and permissions, ELM cannot create
the lock files (which it tries to do in /usr/mail).  The solution which
worked for me was to change the permissions on /usr/mail from 775 to
3777 (rwxrwxr-x to rwxrwsrwt), which seems very common on Suns, although
I don't understand why (by the way, mail with exactly the same
premissions has no such problems).

Somehow it seems that setgid() doesn't work right.  Syd suggested that
perhaps it should be setegid(), but I'm no expert on this stuff.


-- 
William Silvert, Habitat Ecology Division, Bedford Inst. of Oceanography
P. O. Box 1006, Dartmouth, Nova Scotia, CANADA B2Y 4A2.  Tel. (902)426-1577
UUCP=..!{uunet|watmath}!dalcs!biomel!bill
BITNET=bill%biomel%dalcs@dalac	InterNet=bill%biomel@cs.dal.ca

rot@unlisys.in-berlin.de (Robert Rothe) (02/28/91)

silvert@cs.dal.ca (Bill Silvert) writes:
>In article <5079@unlisys.in-berlin.de> rot@unlisys.in-berlin.de (Robert Rothe) writes:
>[discussion about lock files]

>>But why this ? is there no setgid() available, or doesn't it work ?

>the lock files (which it tries to do in /usr/mail).  The solution which
>worked for me was to change the permissions on /usr/mail from 775 to
>3777 (rwxrwxr-x to rwxrwsrwt), which seems very common on Suns, although
>I don't understand why (by the way, mail with exactly the same
>premissions has no such problems).

Making /usr/mail writeable for all doesn't seem to be the solution ..

>Somehow it seems that setgid() doesn't work right.  Syd suggested that
>perhaps it should be setegid(), but I'm no expert on this stuff.

Can anybody confirm that 'setgid (getegid())' doesn't work on irix ?

	robert.

-- 
Unlisys,  Hohenzollerndamm 7, 1000 Berlin 31     ---     Robert Rothe
unido!fub!unlisys!rot,   rot@unlisys.in-berlin.de,    030 / 88 22 980
    * Ein Krieg ist um nichts besser als ein gewoehnlicher Mord *

silvert@cs.dal.ca (Bill Silvert) (03/01/91)

In article <5220@unlisys.in-berlin.de> rot@unlisys.in-berlin.de (Robert Rothe) writes:
>
>>the lock files (which it tries to do in /usr/mail).  The solution which
>>worked for me was to change the permissions on /usr/mail from 775 to
>>3777 (rwxrwxr-x to rwxrwsrwt), which seems very common on Suns, although
>>I don't understand why (by the way, mail with exactly the same
>>premissions has no such problems).
>
>Making /usr/mail writeable for all doesn't seem to be the solution ..

Anyone can write to the directory, but not delete files, so it is not
that big a hole.  Apparently most Suns have these permissions.

>>Somehow it seems that setgid() doesn't work right.  Syd suggested that
>>perhaps it should be setegid(), but I'm no expert on this stuff.
>
>Can anybody confirm that 'setgid (getegid())' doesn't work on irix ?

I got mail from Paul Close that solved the problem.  I changed d_vfork
at his suggestion to undef and recompiled.  According to Paul, the
problem is with vfork on the Iris, and related problems with setgid.
I'm no expert on these things, but I'm glad to have it working.
However, the same solution did not apply to the Stardent.
-- 
William Silvert, Habitat Ecology Division, Bedford Inst. of Oceanography
P. O. Box 1006, Dartmouth, Nova Scotia, CANADA B2Y 4A2.  Tel. (902)426-1577
UUCP=..!{uunet|watmath}!dalcs!biomel!bill
BITNET=bill%biomel%dalcs@dalac	InterNet=bill%biomel@cs.dal.ca