From a4d7c625336b608e35cb6bbc7a8a8b0e31fda42a Mon Sep 17 00:00:00 2001 From: janw Date: Mon, 31 Mar 2008 13:26:48 +0000 Subject: [PATCH] Restored old favor but without Reset Event. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10092 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-si/gosa-si-client | 48 +++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/gosa-si/gosa-si-client b/gosa-si/gosa-si-client index 55c31b425..4ce9ceb4c 100755 --- a/gosa-si/gosa-si-client +++ b/gosa-si/gosa-si-client @@ -992,18 +992,18 @@ sub trigger_logged_in_users_report { # return; #} -#sub generic_file_error { -# my ( $heap, $operation, $errno, $error_string, $wheel_id ) = -# @_[ HEAP, ARG0, ARG1, ARG2, ARG3 ]; -# -# my $service = $heap->{services}->{$wheel_id}; -# daemon_log("ERROR: '$service' watcher $operation error $errno: $error_string", 1); -# daemon_log("ERROR: shutting down '$service' file watcher", 1); -# -# delete $heap->{services}->{$wheel_id}; -# delete $heap->{watchers}->{$wheel_id}; -# return; -#} +sub generic_file_error { + my ( $heap, $operation, $errno, $error_string, $wheel_id ) = + @_[ HEAP, ARG0, ARG1, ARG2, ARG3 ]; + + my $service = $heap->{services}->{$wheel_id}; + daemon_log("ERROR: '$service' watcher $operation error $errno: $error_string", 1); + daemon_log("ERROR: shutting down '$service' file watcher", 1); + + delete $heap->{services}->{$wheel_id}; + delete $heap->{watchers}->{$wheel_id}; + return; +} sub fifo_got_record { @@ -1084,19 +1084,19 @@ sub _start { $kernel->yield('register_at_gosa_si_server'); # install all file watcher defined - while( my($file_name, $file) = each %files_to_watch ) { - #my $file_watcher = POE::Wheel::FollowTail->new( - # Filename => $file, - # InputEvent => $file_name."_record", + while( my($name, $file) = each %files_to_watch ) { + my $watcher = POE::Wheel::FollowTail->new( + Filename => $file, + InputEvent => $name."_record", # ResetEvent => "file_reset", - # ErrorEvent => "file_error", - # ); - $heap->{tail} = POE::Wheel::Run->new( - Program => [ "/usr/bin/tail", "-f", $file ], - StdoutEvent => $file_name."_record", - ); - #$heap->{services}->{ $file_watcher->ID } = $file_name; - #$heap->{watchers}->{ $file_watcher->ID } = $file_watcher; + ErrorEvent => "file_error", + ); +# $heap->{tail} = POE::Wheel::Run->new( +# Program => [ "/usr/bin/tail", "-f", $file ], +# StdoutEvent => $file_name."_record", +# ); + $heap->{services}->{ $watcher->ID } = $name; + $heap->{watchers}->{ $watcher->ID } = $watcher; } $kernel->yield('trigger_logged_in_users_report'); } -- 2.30.2