line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# vim: ft=perl |
2
|
2
|
|
|
2
|
|
576
|
use Ubic::Service::Common; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
58
|
|
3
|
2
|
|
|
2
|
|
330
|
use Ubic::Daemon qw(:all); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
10
|
|
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
|
|
|
|
|
|
|
}); |