tfiles/service/sleeping-common

filter: Statementstmt 100% 6 / 6 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 100% 8 / 8 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« tfiles/service/fake-http-service2 ↑ Summary tfiles/service/sleeping-daemon »
1 # vim: ft=perl
2 89 ▶use Ubic::Service::Common;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 89 ▶use Ubic::Daemon qw(:all);
Subroutine BEGIN: called CC=1 SCAR=0.0
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 });
« tfiles/service/fake-http-service2 ↑ Summary tfiles/service/sleeping-daemon »