Hi,
I'm having problems with a perl program I've written to query disks on a UNIX system. The problem i'm having is around a system process that is launched against each disk in turn. Unfortunately, on some disks, this process will hang so I have built in a 5 seconds alarm to allow the program to continue. This works ok but it leaves the process running on the system and I can't seem to find out how to kill this process after the timeout:
eval {
local $SIG{ALRM} = sub {die "alarm\n"};
alarm 5;
$vgid = `/usr/bin/echo 0x2008?4d | adb /dev/disk/$sdisk 2> /dev/null`;
alarm 0;
};
if ($@) {
$vgid = "unset";
}
I also need the output of the system command in $vgid so don't think I can use exec?
Any ideas
I'm having problems with a perl program I've written to query disks on a UNIX system. The problem i'm having is around a system process that is launched against each disk in turn. Unfortunately, on some disks, this process will hang so I have built in a 5 seconds alarm to allow the program to continue. This works ok but it leaves the process running on the system and I can't seem to find out how to kill this process after the timeout:
eval {
local $SIG{ALRM} = sub {die "alarm\n"};
alarm 5;
$vgid = `/usr/bin/echo 0x2008?4d | adb /dev/disk/$sdisk 2> /dev/null`;
alarm 0;
};
if ($@) {
$vgid = "unset";
}
I also need the output of the system command in $vgid so don't think I can use exec?
Any ideas