File locking between Linux server and HP-UX 10.20 client

We are running into odd file locking problems between our NFS server
which is running on Redhat 9.0 - kernel 2.4.20-8 and HP-UX 10.20
clients.  When a HP-UX 10.20 client requests a file lock on a mounted
directory that resides on Linux, we get the following error: No locks
available

The kernel parameter nflocks is set to 200 which seems like a
reasonable limit. I'm pretty certain this limit isn't being reached,
but it is some type of NFS problem. Has anyone else seen this problem
and fixed it?

I've written a small program that demonstrates the problem:

[madden@hacksaw locktest]$ ./locktest locktest.c
Locking locktest.c...
fcntl: No locks available

/* locktest.c - compiled as: gcc -Wall -O2 locktest.c  -o locktest */

#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

static void setlock(int fd, struct flock fl)
{
    if (fcntl(fd, F_SETLKW, &fl) == -1) {
        perror("fcntl");
        exit(EXIT_FAILURE);
    }
}

int main(int argc, char **argv)
{
    struct flock fl = { F_WRLCK, 0, 0, 0, 0 };
    int fd;

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

    if ((fd = open(argv[1], O_RDWR)) == -1) {
        perror("open");
        exit(EXIT_FAILURE);
    }

    printf("Locking %s...\n", argv[1]);
    fl.l_type = F_RDLCK;
    setlock(fd, fl);
    printf("%s locked successfully.\n\n", argv[1]);

    printf("Unlocking %s...\n", argv[1]);
    fl.l_type = F_UNLCK;
    setlock(fd, fl);
    printf("%s unlocked successfully.\n\n", argv[1]);

    return (EXIT_SUCCESS);
}
0
madden
5/21/2004 3:26:52 PM
comp.sys.hp.hpux 4398 articles. 6 followers. dewi.bening (7) is leader. Post Follow

3 Replies
619 Views

Similar Articles

[PageSpeed] 22
madden@cmsrtp.com (Michael Madden) writes:

> We are running into odd file locking problems between our NFS server
> which is running on Redhat 9.0 - kernel 2.4.20-8 and HP-UX 10.20
> clients.  When a HP-UX 10.20 client requests a file lock on a mounted
> directory that resides on Linux, we get the following error: No locks
> available

tcpdump output would probably shed some light. Also make sure rpc.lockd
is running on the redhat host. 

tim
0
tbutler
5/22/2004 6:01:54 PM
> We are running into odd file locking problems between our NFS server
> which is running on Redhat 9.0 - kernel 2.4.20-8 and HP-UX 10.20
> clients.  When a HP-UX 10.20 client requests a file lock on a mounted
> directory that resides on Linux, we get the following error: No locks
> available

 I would run:

# rpcinfo -p <RH server> 

...from one of the HP clients. This would at lesat reveal if you can contact
the portmapper on the server and whether a lock service is available. The
relevant network status monitor services should be able communicate. Perhaps
you need to check if this is allowed by your firewall configuration.

DaveN.
0
djn
5/24/2004 1:53:39 PM
We figured out the file locking problem.  Either do one of the
following:

1.) Ensure the directory permissions are set to 755 and the file
permissions are set to 644.  The file permissions were 640. Otherwise
the file cannot be locked.

2.) On the Linux server, add the insecure_locks option to
/etc/exports, re-export, and restart NFS.

Thanks,
Mike
0
madden
5/25/2004 10:02:10 PM
Reply:
Similar Artilces:

update file in a flash file
Hi, Have some Solaris 9 flash files which work good. But need to change (update) some config within. How can I do this please? TIA Anton anton_axel@yahoo.co.uk writes: > Have some Solaris 9 flash files which work good. > But need to change (update) some config within. mkdir /var/tmp/flar flar -s -fd /var/tmp/flar s9.flar vi /var/tmp/flar/archive/etc/... flar -c -d /var/tmp/flar s9-new.flar Markus ...

How to copy non-ASCII file to clipboard (e.g. Image file)
Hi, Is there any way that I can copy image file contents to clipboard from command line in Linux? I'm using a command line based screenshot program (scrot) but the output from this command is put in file. I need to have a command to further copy the snapped image file into clipboard, and encapsulate this all into simple push button. Any idea about how to use this? Thanks in advance, Ahmad On Fri, 30 Jul 2010 20:14:50 -0400, A_Omara <ahmad.abdulghany@gmail.com> wrote: > Is there any way that I can copy image file contents to clipboard from > command line in L...

Webgen2 v2.20
Hi Folks, Version 2.20 of !Webgen2 has just been published on my website. http://daves.orpheusweb.co.uk/software/ or click the web button on the webgen2 info window. Changes from v2.19: ... Add an email button to the Info window. A silly oversight on my part! ... Add a contact email address to the !help file. An even sillier oversight on my part ... Add the licence (Freeware) to the Info window ... Amend the 'Go Away!' documents in the sub directories so that they have a proper destination rather than just '..' ... Fixed a couple of minor CSS bugs ... Minor changes to t...

Problem with "Skip file types" in "Find Files".
I would like to search for text files based on some texts. And I want to exclude svn file (i.e. *.svn-base). So I add the extension .svn-base in "Skip file types" and expect Matlab "Find Files" GUI to skip the svn files. However, "Find Files" still returns the svn file. I think "Find Files" has problem with this kind of filename, eg. "abc.c.svn-base". Is it treating "c.svn-base" as extension? However, I try out the Matlab function FILEPARTS and it works fine. >> [pathstr, name, ext, versn] = fileparts('abc.c.svn-base') ...

File.puts or File.write ?
For general purpose file writing, does it matter whether puts or write is used? From the docs, it seems like puts should be used for strings, while write can be used for anything. I'm not really sure what difference there is between the two, but the docs say something about puts adding newlines or something. Thanks, Joe -- Posted via http://www.ruby-forum.com/. Joe Ruby MUDCRAP-CE wrote: > For general purpose file writing, does it matter whether puts or write > is used? From the docs, it seems like puts should be used for strings, > while write can be used for anything....

varied output for df and du on the same file system
Greetings, When I run df -h /var , it displays the disk usage as $ df -h /var/ Filesystem Size Used Avail Use% Mounted on /dev/sda9 4.8G 3.3G 1.3G 73% /var But when I run the du -sh for the same file system , the result varies . du -sh /var/ 3.2G /var/ What is the reason for the difference in results ....... With Thanks in Advance bzaman wrote: > Greetings, > > When I run df -h /var , it displays the disk usag...

File Upload (struts) IllegalArgumentException
Hi I have this code in my jsp page: <html:form action="FileUpload.do"> <html:file property="uploadFilename" /> <html:submit /> </html:form> ....and it works. The code in my action class gets executed. But if I add the encode type property like this: <html:form action="FileUpload.do" enctype="multipart/form-data"> <html:file property="uploadFilename" /> <html:submit /> </html:form> ....then the code in my action class is not executed. Instead I get this error: 500 Internal...

[comp.os.linux.advocacy] FAQ and Primer for COLA, Edition III, Part 2 #4 1779955
Following are excerpts from the official FAQ, entire text is found at: http://www.faqs.org/faqs/linux/advocacy/faq-and-primer/ ******************************************************** [comp.os.linux.advocacy] FAQ and Primer for COLA, Edition III Copyright: (c) 2002 The FAQ and Primer for COLA Team -- All Rights Reserved Frequently Asked Questions and Primer for comp.os.linux.advocacy Edition III April 19, 2002 +-------------------------------------------------+ | Beware of those who would call ...

Cannot create a new file
Hi, Before posting I made sure I upgraded from 2.3.3 to 2.3.4, but the problem is still here. Ive created a little script which, at the end of it, deals with copying two files. All the script works fine except when its at the copy line(s). Nothing gets copied, it crashes at the first open() line. Before using open() I made it the lazy way first and wrote system("cp "+file1+" "+file2), but gaves me that message: IOError: [Errno 2] No such file or directory: '/home/bilange/.hnb-backup/1087861694' I then thought python didnt like file handling external comman...

[Help] Finding Files on a PDA SD Card
Is there any PDA application which will locate file on a SD card through a "global" find command, thereby searching all subdirectories off the root of the card? I had initially thought that McFile would do this. It does not. The problem I am trying to resolve is to find a way to quickly establish the eBooks that I have on my Palm. I have several eBook readers. They seem to put the books all over the card without terribly much rhyme or reason that I am able to discern. If I have books x, y, and z on the card and MobiPocket can read book y, but not book x and iSilo can r...

A free utility for direct copy of Tandem files into Ms Sql, Ms Excel and flat text files
It's an 'Ftp-like' command line utility. You can copy Tandem Enscribe Files and Sql Tables into MS Sql server tables, MS Excel files or flat text files. Filter can be applied on rows and columns, both for Enscribe Files and Sql tables. It's free. Downloadable from http://free.x3.hu/peak-tibor/ Tibor PE�K ...

Other half of 'CGI file upload'
For sake of completeness, this is the CGI script used for testing the 'post file to CGI script' script I posted earlier. It will put the content of the 'data' parameter into the file /tmp/out. ------------ #!/usr/bin/perl # use CGI; $cgi = CGI->new(); open($fh, '>', '/tmp/out'); print $fh ($cgi->param('data')); print("Content-Type: text/plain\n\nOk\n"); Rainer Weikusat <rweikusat@mssgmbh.com> writes: [...] > open($fh, '>', '/tmp/out'); Additional warning: This must not be used on a system with untrus...

backup exec not backing up nsf files
Hi all Running windows2000 backupexec9 and domino 5.06a , have problem in that backupexec will not backup any nsf files !! , as a test i renamed the nsf files to .ft file extensions and it backed up ok .. anyone seen this problem ?? any solutions ?? With BackupExec you need additional Tools to back up open files, since the Diomino server is using all the .nsf files. Renaming will indeed solve it, since the DOmino server will release the file then.. Look for dedicated Domino backup tools.Your BackupExec supplier must also have some agents special for Domino. Note: Most of ...

save .mat file
Hello: I am trying to save a matrix as .mat file like that: save('myfile.mat','matrix','-mat'); It creates in Matlab work folder file myfile without extension(.mat). The type of this file is Microsoft Office Access Table Shortcut. What is wrong? How to fix the problem? Thanks, GB GB wrote: > > > Hello: > I am trying to save a matrix as .mat file like that: > save('myfile.mat','matrix','-mat'); > It creates in Matlab work folder file myfile without > extension(.mat). > The type of this file is Microsoft Office Access Ta...

What types of PC files can I read on a Mac?
I have, on my old PC, several folders of files which are a variety of types, including HTML documents, MHTML documents (archive web pages), saved e-mails (.eml documents), and text documents (.txt). Is it possible for me to transfer and read these folders on a Mac (which I'm considering buying)? Do I have to change them to a different type of file before they're compatible? I need to be able to use these folders on a Mac. Thanks for your help. Amphorae wrote: > > I have, on my old PC, several folders of files which are a variety of types, > including HTML documents, MHT...

Compressing files
I am in need of some highly efficient compressing algorithm. I am having this problem, where in I need to deflate a tar image (tar-1) to load a image onto my Chassis. Now, because of some other tar files(tar-2) being there, I am running out of the required space. Yes, ofcourse the easy solution of removing those tar files(tar-2) is not possible. So is there some way the other tar ball(tar-2) can be compressed further, so that I can get more free disk space fr uncompressing tar-1. To put it straight, is there some way to compress tar files even further. The tar file is already has .gz files i...

FW: Splitting Files
Found out that the application the 'split' files were destined for has a hidden (undocumented) switch that when enabled does an internal split.=20 Thanks to all those who replied to this (have keep all your ideas on file in-case I'm in need of it somewhere else). regards,=20 =20 Robert W.Mills=20 MIS Systems Development Manager=20 Windsong Services=20 +44 (0)20 8309 3604=20 -----Original Message----- From: Robert Mills=20 Sent: 31 May 2006 12:04 To: 3000-L Mail List (hp3000-l@raven.utc.edu) Subject: Splitting Files Greetings to the -L, Have a file, with...

Extracting file permissions
Given a file's path, is there a UNIX command that will return just the access permissions for that file? I'm aware this can be done using multiple commands but I'm hoping to avoid resorting to them. I've been through every book on my shelf and have found nothing that can accomplish this. -- Use ROT-13 on the email address for email replies John Stewart wrote: > Given a file's path, is there a UNIX command that will return just the > access permissions for that file? ls -l path-to-file -- Ronald Florence ron.18james.com In article <BgLtd.829$3q.576@la...

How to create a mac-os 7.5.3 installation cd on a Windows / Linux PC ?
Hello ! How to create a mac-os 7.5.3 installation cd on a Windows / Linux PC ? I got for free from the garbage a Performa 5200 with keyboard and mouse PowerPC603, harddisk Quantum TRB850A, cd-rom Matshit ACD-ROM CR-800SA ( SCSI id 3 ) 40 MB RAM , with installed System 8.1, fully functional, but no Apple installation CD_ROM disk, no Ethernet on the Apple ( no Appletalk on the Linux/Windows PC, no modem, no CD recorder. So I can�t use the working 8.1 system to prepare the CD. So to build the system from new, I would like to install System 7.5.3 ( and upgrade to 7.5.5 later ), downloadab...

MBO file extension revisited
In 2005 I received an email which included an attachment with the extension MBO. I could not open it but with the help from this Group I was able to do so. I have now received another such email but this MBO file contains text and at least one photograph taken with the camera in a mobile phone. I can read the text but cannot see the picture. Can anyone help me please. Thanks for any help. David, -- David Gamble d dot gamble at freeuk dot com In message <8fd69bf74e.d.gamble@d.gamble.freeuk.com> David Gamble <d.gamble@freeuk.com> wrote: > In 2005 I received an ...

Executable file inside a jar file!!
Hi, I have an exe file (start.exe) and more dll files packed in a jar file. The exe file needs the dll's. How do i make running the exe file, without unpacking( extracting/unziping) the jar file? Does anybody have a clue? ...

Re: ERROR: Permanent copy of file WORK.ZFMMEM.UTILITY was deleted.
Always search support.sas.com for uncommon error message: http://support.sas.com/techsup/unotes/SN/018/018679.html On Wed, 6 Jun 2007 18:03:22 -1000, Hassan Eini Zinab <hassan.eini@GMAIL.COM> wrote: >Alohas Folks, > >Sometimes when I initiate SAS or run some programs there is such an >ERROR message in the log: > >*"ERROR: Permanent copy of file WORK.ZFMMEM.UTILITY was deleted."* > >What does that mean? How to debug that? > >Mahalo, >Hassan ...

How do you execute a JAR file?
I'm sorry this is so basic, but I honestly do not know how to do this nor can I find anything online here or anywhere via Google to help me with this one. I have a JAR file that I created on another machine using JDK 1.6.0 and NetBeans 5.5 on WinXP. I copied and pasted that JAR file over to my machine at home also using JDK 1.6.0 and NetBeans 5.5 on WinXP I put the exact directory name where the JAR file resides, "C:\Program Files\Java\jdk1.6.0\classes", in CLASSPATH and rebooted my machine. However, upon CD'*** to that directory and doing "java -classpath . GU...

How-To for writing help files?
Is there a tutorial for writing help files for new Scilab functions and getting them to show up? Thanks. -- http://www.wescottdesign.com Hello, The first info I found related to help pages are here: http://wiki.scilab.org/howto/scilab_documentation_kit I use the XXE tool to write the xml documentation. Then, for the functions to call to build the doc, I found a good skeleton in c:\Program Files\scilab-xxxx\contrib\toolbox_skeleton YC ...

Standard icon files
Does anyone know where the standard file icons are (the piece of paper that's used for any document without a type)? I'd like to modify that icon so that it looks more mac-like than if I build one myself. -- XML is a prime example of retarded innovation. -- Erik Meijer and Peter Drayton, Microsoft Corporation Ulrich Hobelmann <u.hobelmann@web.de> writes: > Does anyone know where the standard file icons are (the piece of paper > that's used for any document without a type)? > > I'd like to modify that icon so that it looks more mac-like th...