| 1 | package Clustericious::Command::lighttpd; | ||||||||||
| 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::Log; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 1 | ▶ | use Clustericious::App; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 1 | ▶ | use Clustericious::Config; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 1 | ▶ | use base 'Clustericious::Command'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 1 | ▶ | use File::Which qw( which ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | # ABSTRACT: Clustericious command to stat lighttpd | ||||||||||
| 12 | 1 | our $VERSION = '1.29'; # VERSION | |||||||||
| 13 | |||||||||||
| 14 | |||||||||||
| 15 | 1 | __PACKAGE__->attr(description => <<EOT); | |||||||||
| 16 | Start a lighttpd web server. | ||||||||||
| 17 | EOT | ||||||||||
| 18 | |||||||||||
| 19 | 1 | __PACKAGE__->attr(usage => <<EOT); | |||||||||
| 20 | Usage $0: lighttpd -f <config file> [...other lighttpd options] | ||||||||||
| 21 | Starts a lighttpd webserver. | ||||||||||
| 22 | Options are passed verbatim to the lighttpd executable. | ||||||||||
| 23 | EOT | ||||||||||
| 24 | |||||||||||
| 25 | 0 | ▶ | sub run { | ||||||||
|
Subroutine
run: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||
| 26 | 0 | my($self, @args) = @_; | |||||||||
| 27 | 0 | my $app_name = $ENV{MOJO_APP}; | |||||||||
| 28 | |||||||||||
| 29 | 0 | ▶ | my $lighttpd = which('lighttpd') or LOGDIE "could not find lighttpd in $ENV{PATH}"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 30 | 0 | DEBUG "starting $lighttpd @args"; | |||||||||
| 31 | 0 | system $lighttpd, @args; | |||||||||
| 32 | 0 | ▶ | die "'$lighttpd @args' Failed to execute: $!" if $? == -1; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 33 | 0 | ▶ | die "'$lighttpd @args' Killed with signal: ", $? & 127 if $? & 127; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 34 | 0 | ▶ | die "'$lighttpd @args' Exited with ", $? >> 8 if $? >> 8; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 35 | } | ||||||||||
| 36 | |||||||||||
| 37 | 1 | 1; | |||||||||
| 38 | |||||||||||
| 39 | __END__ | ||||||||||