I have some common code that many programs call that writes messages to
a log file. It  looks something like...

if (open(LOG, ">>$logfile")) {
   print LOG $message;
   close(LOG) || warn "unable to close log file $logfile";
}
else {
   warn "unable to open $logfile for appending";
}

The problem is  that sometimes the close statement fails (not always)
and I get the warning "upable to close logfile...". The interesting
thing is that it ONLY happens when the log file is on an NFS mounted
(shared) file system but never on a local file system.  This  seems to
happen because multiple people are concurrently appending to the file.
Even though  I am getting errors all the writes seem to work correctly.
That  is, all text appends to the file even when the error is raised
(and it does not always raise).   This piece of code has been in place
for a few years and only recently has reared its head.  The systems
group came in to do some patches and pm to our Unix Solaris system and
it started happening.  They have since gone in and reverted all that
they 'claim' to have done that weekend but it still happens.  It smells
like some kind of file sharing issue but noone is sure.  Has anybody
else out there run into this?

_______________________________________________
Perl-Unix-Users mailing list. To unsubscribe go to 
http://listserv.ActiveState.com/mailman/subscribe/perl-unix-users

Reply via email to