line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package # hidden from cpan |
2
|
|
|
|
|
|
|
Monitoring::Generator::TestConfig::InitScriptData; |
3
|
|
|
|
|
|
|
|
4
|
3
|
|
|
3
|
|
19
|
use strict; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
86
|
|
5
|
3
|
|
|
3
|
|
17
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
601
|
|
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
|
3
|
my $self = shift; |
23
|
1
|
|
|
|
|
2
|
my $prefix = shift; |
24
|
1
|
|
|
|
|
3
|
my $binary = shift; |
25
|
1
|
|
|
|
|
3
|
my $user = shift; |
26
|
1
|
|
|
|
|
2
|
my $group = shift; |
27
|
1
|
|
|
|
|
2
|
my $layout = shift; |
28
|
1
|
|
|
|
|
2
|
our $initsource; |
29
|
1
|
50
|
|
|
|
4
|
if(!defined $initsource) { |
30
|
1
|
|
|
|
|
3
|
$initsource = do { local $/; }; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
23
|
|
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
1
|
|
|
|
|
4
|
my $initscript = $initsource; |
34
|
1
|
|
|
|
|
18
|
$initscript =~ s/__PREFIX__/$prefix/gmx; |
35
|
1
|
|
|
|
|
17
|
$initscript =~ s/__BINARY__/$binary/gmx; |
36
|
1
|
|
|
|
|
16
|
$initscript =~ s/__USER__/$user/gmx; |
37
|
1
|
|
|
|
|
17
|
$initscript =~ s/__GROUP__/$group/gmx; |
38
|
1
|
|
|
|
|
29
|
$initscript =~ s/__LAYOUT__/$layout/gmx; |
39
|
1
|
|
|
|
|
16
|
return($initscript); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
__DATA__ |