in reply to Re: How to monitor an NFS mount with perl
in thread How to monitor an NFS mount with perl
Hi I tried the Sig alarm idea and found the Signal was blocked by the open file hanging. Had the following code
The Sigalarm subroutine never got called after the NFS
got dropped..
$SIG{SIGALRM)=sub {do something};
while(true)
{
alarm 5; # set a 5 second alarm
if(!open(TESTMOUNT,"$testfile"))
{
do something
}
else
{
do somethineelse
}
close(TESTMOUNT);
alarm 0; # disable alarm
sleep 5;
}