On 20 Feb 2008, at 23:22, Andy Armstrong wrote:
> No it doesn't - it fails to kill the dtrace process. Sorry.
>
> So you need to find the PID of dtrace and send SIGINT to that
> directly.
Or just cheat and do the IO redirection in Perl :)
#!/usr/bin/perl
use strict;
use warnings;
my $pid = fork;
die "Fork failed ($!)\n" unless defined $pid;
unless ( $pid ) {
open my $log, '>', 'flow.log'
or die "Can't write log ($!)\n";
open my $dt, '-|', 'examples/pl_flow.d'
or die "Can't run dtrace ($!)\n";
print $log $_ while <$dt>;
exit;
}
for ( 1 .. 3 ) {
print "Waiting...\n";
sleep 1;
}
kill 9, $pid;
1 while 0 < waitpid -1, 0;
--
Andy Armstrong, Hexten
_______________________________________________
dtrace-discuss mailing list
[email protected]