line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Ubic::Service; |
2
|
|
|
|
|
|
|
$Ubic::Service::VERSION = '1.59'; |
3
|
26
|
|
|
26
|
|
7302
|
use strict; |
|
26
|
|
|
|
|
30
|
|
|
26
|
|
|
|
|
628
|
|
4
|
26
|
|
|
26
|
|
81
|
use warnings; |
|
26
|
|
|
|
|
25
|
|
|
26
|
|
|
|
|
497
|
|
5
|
|
|
|
|
|
|
|
6
|
26
|
|
|
26
|
|
5452
|
use Ubic::Settings; |
|
26
|
|
|
|
|
37
|
|
|
26
|
|
|
|
|
698
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# ABSTRACT: interface and the base class for any ubic service |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
26
|
|
|
26
|
|
552
|
use Ubic::Result qw(result); |
|
26
|
|
|
|
|
36
|
|
|
26
|
|
|
|
|
9031
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub start { |
14
|
0
|
|
|
0
|
1
|
0
|
die "not implemented"; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub stop { |
18
|
0
|
|
|
0
|
1
|
0
|
die "not implemented"; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub status { |
22
|
0
|
|
|
0
|
1
|
0
|
my ($self) = @_; |
23
|
0
|
|
|
|
|
0
|
die "not implemented"; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub reload { |
27
|
0
|
|
|
0
|
1
|
0
|
my ($self) = @_; |
28
|
0
|
|
|
|
|
0
|
return result('unknown', 'not implemented'); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub port { |
32
|
0
|
|
|
0
|
1
|
0
|
my ($self) = @_; |
33
|
0
|
|
|
|
|
0
|
return; # by default, service has no port |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub user { |
37
|
92
|
|
|
92
|
1
|
113
|
my $self = shift; |
38
|
92
|
|
|
|
|
460
|
return Ubic::Settings->default_user; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub group { |
42
|
92
|
|
|
92
|
1
|
213
|
return (); |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub check_period { |
46
|
0
|
|
|
0
|
1
|
0
|
my ($self) = @_; |
47
|
0
|
|
|
|
|
0
|
return 60; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub check_timeout { |
51
|
0
|
|
|
0
|
1
|
0
|
return 60; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub custom_commands { |
55
|
0
|
|
|
0
|
1
|
0
|
return (); |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub do_custom_command { |
59
|
0
|
|
|
0
|
1
|
0
|
die "No such command"; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub name($;$) { |
63
|
287
|
|
|
287
|
1
|
841
|
my ($self, $name) = @_; |
64
|
287
|
100
|
|
|
|
524
|
if (defined $name) { |
65
|
38
|
|
|
|
|
136
|
$self->{name} = $name; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
else { |
68
|
249
|
|
|
|
|
969
|
return $self->{name}; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
sub full_name($) { |
73
|
193
|
|
|
193
|
1
|
328
|
my ($self) = @_; |
74
|
193
|
|
|
|
|
523
|
my $parent_name = $self->parent_name; |
75
|
193
|
100
|
|
|
|
476
|
if (defined $parent_name) { |
76
|
13
|
|
|
|
|
41
|
return $parent_name.".".$self->name; |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
else { |
79
|
180
|
|
|
|
|
540
|
return $self->name; |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
sub parent_name($;$) { |
84
|
238
|
|
|
238
|
1
|
313
|
my ($self, $name) = @_; |
85
|
238
|
100
|
|
|
|
537
|
if (defined $name) { |
86
|
10
|
|
|
|
|
26
|
$self->{parent_name} = $name; |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
else { |
89
|
228
|
|
|
|
|
528
|
return $self->{parent_name}; |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
sub auto_start($) { |
94
|
0
|
|
|
0
|
1
|
|
return 0; |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
1; |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
__END__ |