/[pxelator]/lib/PXElator/httpd.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /lib/PXElator/httpd.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 78 by dpavlin, Fri Jul 31 14:43:30 2009 UTC revision 81 by dpavlin, Fri Jul 31 16:47:52 2009 UTC
# Line 111  sub start_stop { Line 111  sub start_stop {
111                          return qq|$daemon pid $pid started|;                          return qq|$daemon pid $pid started|;
112                  } elsif ( defined $pid ) {                  } elsif ( defined $pid ) {
113                          # child                          # child
114                          my $eval = $daemon . '::start(' . ( @_ ? dump(@_) : '' ) . ')';                          my $invoke = 'start';
115                            $invoke = $1 if $daemon =~ s{/(.+)}{};
116                            my $eval = $daemon . '::' . $invoke . '(' . ( @_ ? dump(@_) : '' ) . ')';
117                          warn "eval $eval";                          warn "eval $eval";
118                          eval $eval;                          eval $eval;
119                          warn "can't start $daemon: $@" if $@;                          warn "can't start $daemon: $@" if $@;
# Line 153  sub get_request { Line 155  sub get_request {
155    
156                          my $html = qq|<a href=/$name>$pid</a>|;                          my $html = qq|<a href=/$name>$pid</a>|;
157    
158                          if ( $debug ) {                          my $proc = "/proc/$pid/status";
                                 $html .= qq| <a name=$pid href=#proc-$pid>?</a>|;  
159    
160                                  my $proc = "/proc/$pid/status";                          if ( -e $proc ) {
161                                  $debug_proc                                  if ( $debug ) {
162                                          .= qq|<a name=proc-$pid href=#$pid>$proc</a><pre style="font-size: 10%">|                                          $html .= qq| <a name=$pid href=#proc-$pid>?</a>|;
163                                          .  read_file($proc)  
164                                          .  qq|</pre>|                                          $debug_proc
165                                          if -e $proc;                                                  .= qq|<a name=proc-$pid href=#$pid>$proc</a><pre style="font-size: 10%">|
166                                                    .  read_file($proc)
167                                                    .  qq|</pre>|
168                                                    ;
169                                    }
170    
171                                    if ( $name->can('start_options') ) {
172                                            $html .= qq| <a href=/kvm/$_>$_</a>| foreach $name->start_options;
173                                    }
174                          }                          }
175    
176                          push @rows, ( $name => $html );                          push @rows, ( $name => $html );
# Line 188  sub get_request { Line 197  sub get_request {
197                  warn $@ if $@;                  warn $@ if $@;
198                  print $client $redirect, qq|<big>$1 = $2</big><br>Location: <a href="$url">$url</a>|;                  print $client $redirect, qq|<big>$1 = $2</big><br>Location: <a href="$url">$url</a>|;
199                  server::debug( $debug ) if $1 eq 'debug';                  server::debug( $debug ) if $1 eq 'debug';
200          } elsif ( $path =~ m{^/(screen|kvm)} ) {          } elsif ( $path =~ m{^/((?:screen|kvm).*)} ) {
201                  print $client $redirect, start_stop($1);                  print $client $redirect, start_stop($1);
202          } elsif ( $path =~ m{^/kill/static/(\d+)} ) {          } elsif ( $path =~ m{^/kill/static/(\d+)} ) {
203                  print $client $redirect;                  print $client $redirect;

Legend:
Removed from v.78  
changed lines
  Added in v.81

  ViewVC Help
Powered by ViewVC 1.1.26