return qq|$daemon pid $pid started|;
} elsif ( defined $pid ) {
# child
- my $eval = $daemon . '::start(' . ( @_ ? dump(@_) : '' ) . ')';
+ my $invoke = 'start';
+ $invoke = $1 if $daemon =~ s{/(.+)}{};
+ my $eval = $daemon . '::' . $invoke . '(' . ( @_ ? dump(@_) : '' ) . ')';
warn "eval $eval";
eval $eval;
warn "can't start $daemon: $@" if $@;
my $html = qq|<a href=/$name>$pid</a>|;
- if ( $debug ) {
- $html .= qq| <a name=$pid href=#proc-$pid>?</a>|;
+ my $proc = "/proc/$pid/status";
- my $proc = "/proc/$pid/status";
- $debug_proc
- .= qq|<a name=proc-$pid href=#$pid>$proc</a><pre style="font-size: 10%">|
- . read_file($proc)
- . qq|</pre>|
- if -e $proc;
+ if ( -e $proc ) {
+ if ( $debug ) {
+ $html .= qq| <a name=$pid href=#proc-$pid>?</a>|;
+
+ $debug_proc
+ .= qq|<a name=proc-$pid href=#$pid>$proc</a><pre style="font-size: 10%">|
+ . read_file($proc)
+ . qq|</pre>|
+ ;
+ }
+
+ if ( $name->can('start_options') ) {
+ $html .= qq| <a href=/kvm/$_>$_</a>| foreach $name->start_options;
+ }
}
push @rows, ( $name => $html );
warn $@ if $@;
print $client $redirect, qq|<big>$1 = $2</big><br>Location: <a href="$url">$url</a>|;
server::debug( $debug ) if $1 eq 'debug';
- } elsif ( $path =~ m{^/(screen|kvm)} ) {
+ } elsif ( $path =~ m{^/((?:screen|kvm).*)} ) {
print $client $redirect, start_stop($1);
} elsif ( $path =~ m{^/kill/static/(\d+)} ) {
print $client $redirect;