--- lib/PXElator/httpd.pm 2009/08/16 21:35:23 229 +++ lib/PXElator/httpd.pm 2009/08/19 11:02:15 262 @@ -53,6 +53,7 @@ use network; use ip; use wireshark; +use syslogd; use CouchDB; @@ -124,14 +125,14 @@ warn "static $found" if $debug; } elsif ( $path eq '/' ) { - my @rows = ( - 'debug', qq|$debug|, - ); + my @rows; my $debug_proc = ''; +warn "XXX pids = ", dump( $daemons::pids ); + foreach my $name ( sort keys %$daemons::pids ) { - my $pid = $daemons::pids->{$name} || next; + my $pid = $daemons::pids->{$name}; # || next; my $html; @@ -157,12 +158,19 @@ $html .= qq| $_| foreach $name->actions; } } else { - $html .= qq|restart $pid exited| if $name->can('start'); + if ( $pid =~ m{^\d+$} ) { + $html .= qq|$pid exited | + } else { + $html .= qq|$pid |; + } + $html .= qq|restart| if $pid || $name->can('start'); if ( $name->can('fork_actions') ) { $html .= qq| $_| foreach $name->fork_actions; } } + die "no html generated" unless $html; + push @rows, ( $name => $html ); } @@ -190,7 +198,12 @@ } elsif ( $path =~ m{^/server} ) { print $client ok - , html::table( 2, map { ( $_, html::tt eval '$server::'.$_ ) } ( 'ip', 'netmask', 'ip_from', 'ip_to', 'domain_name', 'base_dir', 'conf' ) ) + , html::table( 2, + 'debug' => qq|$debug|, + map { + ( $_, html::tt eval '$server::'.$_ ) + } ( 'ip', 'netmask', 'ip_from', 'ip_to', 'domain_name', 'base_dir', 'conf' ) + ) ; } elsif ( $path =~ m!^/client(?:/$RE{net}{IPv4}{-keep})?! ) { my $ip = $1 || $client->peerhost; @@ -227,7 +240,7 @@ ; if ( my $amt = client::conf( $ip, 'amt' ) ) { - print $client qq|

AMT

|, amt::info( $amt ); + print $client qq|

AMT

|, amt::info( $amt, $ip ); } } else { @@ -307,7 +320,7 @@ warn 'network ', network::setup(); daemons::start_stop 'browser', $url; - daemons::start_stop $_ foreach ( qw/dhcpd tftpd dnsd/ ); + daemons::start_stop $_ foreach ( qw/dhcpd tftpd dnsd syslogd/ ); daemons::start_stop 'kvm' unless $ENV{DEV}; # skip kvm statup when running on real device my $server = IO::Socket::INET->new(