[rrd-users] Re: First post...looking for more info...

Rainer Bawidamann Rainer.Bawidamann at rz.uni-ulm.de
Tue Nov 14 11:57:55 MET 2000


In article <200011132349.AAA02898 at slot.hollandcasino.nl>,
	alex at slot.hollandcasino.nl (Alex van den Bogaerdt) writes:
> 
> Karyn Ulriksen wrote:
>> 
>> yup...  its an nfs issue...  works on local volumes just fine...
>> 
>> will be changing thread here...
> 
> glad you've found it.  While I think this is not an RRDtool
> problem per se, maybe Tobi can fix it somewhere, somehow?

rrdtool uses fcntl to lock the rrd file. This needs a nfs implementation
with working locking. The original sun nfs has working locking. Linux
might have it with with version 2.2 or 2.4, don't know exactly. Look for
a running "lockd".

Maybe rrdtool could handle "ENOLCK" (no locks available) differently and
skip locking or use lock files.

> Anyway, what version of the software?  RHx.y, NFS on both sides
> etcetera, etcetera.

I suppose Linux 2.0 or 2.2 without lockd ...

Rainer

PS: Use the following C program to test wether your nfs has working
locking:

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

main() {
	FILE *rrd_file;
	struct flock lock;
	int stat, rrd_fd;
	
	rrd_file = fopen("lockfile", "w+");
	if (rrd_file == NULL) {
		perror("open");
		exit(1);
	}
	fprintf(rrd_file, "testinhalt\n");
	fflush(rrd_file);
	lock.l_type = F_WRLCK;
	lock.l_len = 0;
	lock.l_start = 0;
	lock.l_whence = SEEK_SET;
	rrd_fd = fileno(rrd_file);
	stat = fcntl(rrd_fd, F_SETLK, &lock);
	if (stat) {
		perror("fcntl");
		exit(1);
	}
	printf("konnte lockfile locken\n");
	fclose(rrd_file);
	unlink("loclfile");
}

--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-users mailing list