| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
# vim: ft=perl |
|
2
|
2
|
|
|
2
|
|
804
|
use Ubic::Service::Common; |
|
|
2
|
|
|
|
|
7
|
|
|
|
2
|
|
|
|
|
86
|
|
|
3
|
2
|
|
|
2
|
|
369
|
use Ubic::Daemon qw(:all); |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
16
|
|
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
my $pidfile = "tfiles/sleeping-common.pid"; |
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
Ubic::Service::Common->new({ |
|
8
|
|
|
|
|
|
|
start => sub { |
|
9
|
|
|
|
|
|
|
my $pid; |
|
10
|
|
|
|
|
|
|
start_daemon({ |
|
11
|
|
|
|
|
|
|
function => sub { sleep 100 }, |
|
12
|
|
|
|
|
|
|
name => 'sleeping-common', |
|
13
|
|
|
|
|
|
|
pidfile => $pidfile, |
|
14
|
|
|
|
|
|
|
}); |
|
15
|
|
|
|
|
|
|
}, |
|
16
|
|
|
|
|
|
|
stop => sub { |
|
17
|
|
|
|
|
|
|
stop_daemon($pidfile); |
|
18
|
|
|
|
|
|
|
}, |
|
19
|
|
|
|
|
|
|
status => sub { |
|
20
|
|
|
|
|
|
|
return check_daemon($pidfile); |
|
21
|
|
|
|
|
|
|
}, |
|
22
|
|
|
|
|
|
|
custom_commands => { |
|
23
|
|
|
|
|
|
|
'2plus2' => sub { return 4 }, |
|
24
|
|
|
|
|
|
|
'3plus3' => sub { return 6 }, |
|
25
|
|
|
|
|
|
|
}, |
|
26
|
|
|
|
|
|
|
}); |