| 1 | package Clustericious::Command::apache; | ||||||||||||
| 2 | |||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | 1 | ▶ | use Clustericious::App; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | 1 | ▶ | use base 'Clustericious::Command'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | 1 | ▶ | use File::Which qw( which ); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 8 | |||||||||||||
| 9 | # ABSTRACT: Clustericious command to stat Apache | ||||||||||||
| 10 | 1 | our $VERSION = '1.29'; # VERSION | |||||||||||
| 11 | |||||||||||||
| 12 | |||||||||||||
| 13 | 1 | __PACKAGE__->attr(description => <<EOT); | |||||||||||
| 14 | Start an Apache web server. | ||||||||||||
| 15 | EOT | ||||||||||||
| 16 | |||||||||||||
| 17 | 1 | __PACKAGE__->attr(usage => <<EOT); | |||||||||||
| 18 | Usage $0: Apache -f <conf> [...other Apache options] | ||||||||||||
| 19 | Starts an Apache webserver. | ||||||||||||
| 20 | Options are passed verbatim to the httpd executable. | ||||||||||||
| 21 | EOT | ||||||||||||
| 22 | |||||||||||||
| 23 | 0 | ▶ | sub run { | ||||||||||
|
Subroutine
run: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||
| 24 | 0 | my($self, @args) = @_; | |||||||||||
| 25 | 0 | $self->app->init_logging; | |||||||||||
| 26 | 0 | ▶ | my $command = which('httpd') || die "unable to find apache"; | ||||||||||
|
Condition0%0/2
which('httpd') || die('unable to find apache')
MC/DC0%0/1
which('httpd') || die('unable to find apache')
which('httpd')
Truth table0%0/2
A
A= which('httpd')
| |||||||||||||
| 27 | 0 | system $command, @args; | |||||||||||
| 28 | 0 | ▶ | die "'$command @args' Failed to execute: $!" if $? == -1; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 29 | 0 | ▶ | die "'$command @args' Killed with signal: ", $? & 127 if $? & 127; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 30 | 0 | ▶ | die "'$command @args' Exited with ", $? >> 8 if $? >> 8; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 31 | } | ||||||||||||
| 32 | |||||||||||||
| 33 | 1 | 1; | |||||||||||
| 34 | |||||||||||||
| 35 | __END__ | ||||||||||||