--- lib/PXElator/httpd.pm 2009/07/31 17:41:19 86 +++ lib/PXElator/httpd.pm 2009/07/31 18:48:29 91 @@ -150,10 +150,10 @@ my $debug_proc; warn 'pids: ', dump( $pids ) if $debug; - foreach my $name ( keys %$pids ) { + foreach my $name ( sort keys %$pids ) { my $pid = $pids->{$name} || next; - my $html = qq|$pid|; + my $html = qq|$pid|; my $proc = "/proc/$pid/status"; @@ -168,26 +168,36 @@ ; } - if ( $name->can('start_options') ) { - $html .= qq| $_| foreach $name->start_options; + if ( $name->can('start_fork') ) { + $html .= qq| $_| foreach $name->start_fork; + } + + if ( $name->can('actions') ) { + $html .= qq| $_| foreach $name->actions; } } push @rows, ( $name => $html ); } + my $below_table = ''; + warn 'static_pids: ', dump( $static_pids ) if $debug; foreach my $pid ( keys %$static_pids ) { my $path = $static_pids->{$pid}; if ( -d "/proc/$pid" ) { push @rows, ( $path => qq|$pid| ); + } elsif ( $param->{clean_completed_downloads} ) { + delete $static_pids->{$pid} } else { push @rows, ( $path => "$pid competed" ); + $below_table = qq|clean completed downloads|; } } print $client $ok , html::table( 2, @rows ) + , $below_table , html::tabs( log::mac_changes ) , $debug_proc ; @@ -197,8 +207,11 @@ warn $@ if $@; print $client $redirect, qq|$1 = $2
Location: $url|; server::debug( $debug ) if $1 eq 'debug'; - } elsif ( $path =~ m{^/((?:screen|kvm).*)} ) { + } elsif ( $path =~ m{^/start_stop/((?:screen|kvm).*)} ) { # XXX we don't want to stop all classes print $client $redirect, start_stop($1); + } elsif ( $path =~ m{^/action/([^/]+)/(.+)} ) { + $1->$2(); + print $client $redirect; } elsif ( $path =~ m{^/kill/static/(\d+)} ) { print $client $redirect; kill 1, $1 || kill 9, $2 && warn "killed $1";