File Coverage

lib/Rex/Service/Debian.pm
Criterion Covered Total %
statement 8 14 57.1
branch n/a
condition 0 3 0.0
subroutine 3 4 75.0
pod 0 1 0.0
total 11 22 50.0


line stmt bran cond sub pod time code
1             #
2             # (c) Jan Gehring
3             #
4              
5             package Rex::Service::Debian;
6              
7 1     1   14 use v5.12.5;
  1         4  
8 1     1   5 use warnings;
  1         2  
  1         60  
9              
10             our $VERSION = '1.14.3'; # VERSION
11              
12 1     1   6 use base qw(Rex::Service::Base);
  1         4  
  1         231  
13              
14             sub new {
15 0     0 0   my $that = shift;
16 0   0       my $proto = ref($that) || $that;
17 0           my $self = $proto->SUPER::new(@_);
18              
19 0           bless( $self, $proto );
20              
21             $self->{commands} = {
22 0           start => '/etc/init.d/%s start',
23             restart => '/etc/init.d/%s restart',
24             stop => '/etc/init.d/%s stop',
25             reload => '/etc/init.d/%s reload',
26             status => '/etc/init.d/%s status',
27             ensure_stop => 'update-rc.d -f %s remove',
28             ensure_start => 'update-rc.d %s defaults',
29             action => '/etc/init.d/%s %s',
30             service_exists => '/usr/sbin/service --status-all 2>&1 | grep %s',
31             };
32              
33 0           return $self;
34             }
35              
36             1;