--- lib/PXElator/httpd.pm 2009/08/06 18:10:31 162 +++ lib/PXElator/httpd.pm 2009/08/09 16:37:46 179 @@ -52,6 +52,7 @@ use config; use client; use log; +use x11; sub static { my ($client,$path) = @_; @@ -135,7 +136,7 @@ if ( $daemon =~ m{dhcpd|tftpd|dnsd} ) { my $exec = "perl -I$server::base_dir/lib -I$server::base_dir/lib/PXElator -M$daemon -e ${daemon}::${invoke}"; warn "exec $exec"; - exec "xterm -T $daemon -n $daemon -e $exec"; + x11::xterm( $daemon => $exec ); } else { my $eval = $daemon . '::' . $invoke . '(' . ( @_ ? dump(@_) : '' ) . ')'; warn "eval $eval"; @@ -173,11 +174,12 @@ foreach my $name ( sort keys %$pids ) { my $pid = $pids->{$name} || next; - my $html = qq|$pid|; + my $html; my $proc = "/proc/$pid/status"; if ( -e $proc ) { + $html .= qq|$pid|; if ( $debug ) { $html .= qq| ?|; @@ -195,6 +197,8 @@ if ( $name->can('actions') ) { $html .= qq| $_| foreach $name->actions; } + } else { + $html .= qq|restart $pid exited|; } push @rows, ( $name => $html ); @@ -235,6 +239,7 @@ , qq|
| , html::table( 2, 'ip' => $ip, + 'mac' => client::mac( $ip ), 'hostname' => qq||, 'deploy' => html::select( 'deploy', $deploy, config::available ), ) @@ -246,16 +251,15 @@ } else { print $client $ok , qq|

Clients on $server::ip

| - , qq|| ; } } elsif ( $path =~ m{^/our/(\w+)/(\S+)} ) { @@ -298,7 +302,7 @@ start_stop 'dhcpd'; start_stop 'tftpd'; start_stop 'dnsd'; - start_stop 'kvm'; + start_stop 'kvm' unless $ENV{DEV}; # skip kvm statup when running on real device while (1) { my $client = $server->accept() || next; # ALARM trickle us