blib/lib/Ereshkigal/App/Command/stop.pm

filter: Statementstmt 100% 24 / 24 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 9 / 9 Podpod 100% 5 / 5 totaltotal 100% 40 / 40 CC 2 SCAR 1.8
CC
2
Cov
100%
validate_args
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« blib/lib/Ereshkigal/App/Command/banned.pm ↑ Summary blib/lib/Ereshkigal/App/Command/cidr_unban.pm »
1 package Ereshkigal::App::Command::stop;
2  
3 2 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use Ereshkigal::App -command;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 =head1 NAME
9  
10 Ereshkigal::App::Command::stop - Stop all the kur instances and the manager.
11  
12 =head1 VERSION
13  
14 Version 0.0.1
15  
16 =cut
17  
18 2 our $VERSION = '0.0.1';
19  
20 =head1 SYNOPSIS
21  
22 ereshkigal stop
23  
24 =head1 DESCRIPTION
25  
26 Stops every kur instance and then the manager. Each kur checkpoints its
27 tablets, tears its firewall setup down, and exits; the manager follows.
28  
29 Tearing down removes the tables, sets, chains, and lists the kurs own, so
30 every ban stops being enforced... the host is unprotected by anything
31 Ereshkigal was doing until it is started again. The bans themselves are not
32 forgotten, the tablets being written before the teardown, so starting back up
33 re-bans everything whose sentence has not run out in the meantime.
34  
35 This returns as soon as the shutdown has been requested rather than once it
36 has finished, which is why L<start|Ereshkigal::App::Command::start> waits for
37 the old PID file to clear before taking over.
38  
39 =head1 METHODS
40  
41 The App::Cmd hooks this subcommand supplies... abstract, description,
42 usage_desc, validate_args, and execute.
43  
44 =cut
45  
46 1 ▶sub abstract { return 'stop all the kur instances and the manager' }
Subroutine abstract: called CC=1 SCAR=0.0
Pod documented
47  
48 5 ▶sub description {
Subroutine description: called CC=1 SCAR=0.0
Pod documented
49 5 return <<'DESCRIPTION';
50 Stop every kur instance and then the manager.
51  
52 Each kur checkpoints its tablets, tears its firewall setup down, and
53 exits; the manager follows. Tearing down removes the tables, sets,
54 chains, and lists the kurs own, so EVERY ban stops being enforced. The
55 host is unprotected by anything Ereshkigal was doing until it is started
56 again.
57  
58 The bans themselves are not forgotten. The tablets are written before the
59 teardown, so starting back up re-bans everything whose sentence has not
60 run out in the meantime.
61  
62 This returns as soon as the shutdown has been requested, not once it has
63 finished, which is why "start" waits for the old PID file to clear before
64 taking over.
65 DESCRIPTION
66 } ## end sub description
67  
68 8 ▶sub usage_desc { return '%c stop %o'; }
Subroutine usage_desc: called CC=1 SCAR=0.0
Pod documented
69  
70 3 ▶sub validate_args {
Subroutine validate_args: called CC=2 SCAR=6.9
Pod documented
71 3 my ( $self, $opt, $args ) = @_;
72  
73 3 ▶ if ( @{$args} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@{$args;}) 1 2 3
74 1 $self->usage_error('stop does not take any args');
75 }
76  
77 2 return;
78 }
79  
80 2 ▶sub execute {
Subroutine execute: called CC=1 SCAR=0.0
Pod documented
81 2 my ( $self, $opt, $args ) = @_;
82  
83 2 $self->run_command('stop');
84  
85 1 return;
86 }
87  
88 2 1;
« blib/lib/Ereshkigal/App/Command/banned.pm ↑ Summary blib/lib/Ereshkigal/App/Command/cidr_unban.pm »