I have a script that runs the ptail command with an open descriptor. After 30 seconds, I close the descriptor. But the descriptor is not closed. When the script is closed the tail is present in ps aux.
This code is working well in FreeBSD 8.2, but in FreeBSD 9.0 it's not working.
--
Best Regards
Alexander
Code:
$log_file = path_to_log;
eval {
local $SIG{ALRM} = sub { die; };
alarm (30);
open (LOG, "tail -F $log_file|") || die "Сan`t open logfile \"$log_file\"";
while (<LOG>) {
***
}
alarm (0);
};
close (LOG);
print ("Ok\n");
exit(0);
This code is working well in FreeBSD 8.2, but in FreeBSD 9.0 it's not working.
--
Best Regards
Alexander