🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.cray
Article #121

How to get around lack of statd/lockd on UNICOS

#121
From: Jeff Bauer
Date: Tue, 15 Sep 1992 14:18
59 lines
2385 bytes
Cray apparently chose not to support the statd/lockd daemon on UNICOS.

We have a third party application running on an RS/6000 using a data file
that is NFS mounted from the Cray.  It behaves VERY slowly and the RS/6000
console whines about not being able to talk to statd/lockd on the Cray.

It is the flock() call causing the problem.  This program
runs immediately when locking a file on a local disk as well as a file system
mounted from an AIX host and SunOS NFS server.  It hangs at
the "Locking file..." message when using a file NFS-mounted from the Cray.
The absence or presence of the local lockd/statd daemons makes no difference.  
It does, however, cause the other NFS cases (AIX and Sun) to hang until they
are running.

Does anybody know of a work around for this?  I can either spoof the Cray
with a dummy statd/lockd daemon(s) or somehow tell AIX not to use statd/lockd
and ignore any file locks.

Any help or pointers would be greatly appreciated!

-- flock.c --
#include <stdio.h>
#include <fcntl.h>
#include <sys/file.h>

main(argc, argv)
int argc;
char **argv;
{
        int fd;

        if (argc != 2) {
          fprintf(stderr, "Usage : %s file\n", argv[0]);
          exit(1);
        }

        printf("Opening file...\n");
        if ((fd = open(argv[1], O_RDWR)) < 0) {
          fprintf(stderr, "Cannot open file `%s'\n", argv[1]);
          perror("open");
          exit(1);
        }

        printf("Locking file...\n");
        if (flock(fd, LOCK_EX) < 0) {
          perror("flock lock");
          exit(1);
        }
        printf("Unlocking file...\n");
        if (flock(fd, LOCK_UN) < 0) {
          perror("flock unlock");
          exit(1);
        }
        close(fd);
        printf("All done!\n");
}
--
Jeff Bauer				   jtbauer@cc.fsu.edu
FSU Academic Computing & Network Services  (904) 644-2591 x. 113
Technical Details
Message-ID: <1992Sep15.141839.21110@mailer.cc.fsu.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!gatech!mailer.cc.fsu.edu!loligo.cc.fsu.edu!bauer

Show Full Headers
Complete Article Headers
Newsgroups: comp.unix.cray
Path: arc1-ca.pugleaf.net!sparky!uunet!gatech!mailer.cc.fsu.edu!loligo.cc.fsu.edu!bauer
From: bauer@loligo.cc.fsu.edu (Jeff Bauer)
Subject: How to get around lack of statd/lockd on UNICOS
Message-ID: <1992Sep15.141839.21110@mailer.cc.fsu.edu>
Sender: news@mailer.cc.fsu.edu (Usenet News File Owner)
Nntp-Posting-Host: loligo.cc.fsu.edu
Organization: Florida State University Academic Computing & Network Services
Date: Tue, 15 Sep 92 14:18:39 GMT
Lines: 59