line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package # hidden from cpan |
2
|
|
|
|
|
|
|
Monitoring::Generator::TestConfig::InitScriptData; |
3
|
|
|
|
|
|
|
|
4
|
3
|
|
|
3
|
|
8
|
use strict; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
60
|
|
5
|
3
|
|
|
3
|
|
13
|
use warnings; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
494
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
######################################## |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=over 4 |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=item get_init_script |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
returns the init script source |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
adapted from the nagios debian package |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=back |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=cut |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub get_init_script { |
22
|
1
|
|
|
1
|
1
|
2
|
my $self = shift; |
23
|
1
|
|
|
|
|
1
|
my $prefix = shift; |
24
|
1
|
|
|
|
|
2
|
my $binary = shift; |
25
|
1
|
|
|
|
|
1
|
my $user = shift; |
26
|
1
|
|
|
|
|
1
|
my $group = shift; |
27
|
1
|
|
|
|
|
1
|
my $layout = shift; |
28
|
1
|
|
|
|
|
1
|
our $initsource; |
29
|
1
|
50
|
|
|
|
2
|
if(!defined $initsource) { |
30
|
1
|
|
|
|
|
4
|
while(my $line = ) { $initsource .= $line; } |
|
196
|
|
|
|
|
248
|
|
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
1
|
|
|
|
|
4
|
my $initscript = $initsource; |
34
|
1
|
|
|
|
|
10
|
$initscript =~ s/__PREFIX__/$prefix/gmx; |
35
|
1
|
|
|
|
|
7
|
$initscript =~ s/__BINARY__/$binary/gmx; |
36
|
1
|
|
|
|
|
8
|
$initscript =~ s/__USER__/$user/gmx; |
37
|
1
|
|
|
|
|
7
|
$initscript =~ s/__GROUP__/$group/gmx; |
38
|
1
|
|
|
|
|
14
|
$initscript =~ s/__LAYOUT__/$layout/gmx; |
39
|
1
|
|
|
|
|
7
|
return($initscript); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
__DATA__ |