| 1 | # vim: ft=perl | ||||||||||
| 2 | |||||||||||
| 3 | 91 | ▶ | use parent qw(Ubic::Service::Skeleton); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 91 | ▶ | use Ubic::Daemon qw(:all); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | my $pidfile = 'tfiles/slow.pid'; | ||||||||||
| 7 | |||||||||||
| 8 | sub new { | ||||||||||
| 9 | 91 | ▶ | return bless {} => shift; | ||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||
| 10 | } | ||||||||||
| 11 | |||||||||||
| 12 | sub start_impl { | ||||||||||
| 13 | 3 | ▶ | start_daemon({ | ||||||||
|
Subroutine
start_impl: called CC=1 SCAR=0.0
| |||||||||||
| 14 | bin => 'sleep 1000', | ||||||||||
| 15 | pidfile => $pidfile, | ||||||||||
| 16 | }); | ||||||||||
| 17 | } | ||||||||||
| 18 | |||||||||||
| 19 | sub stop_impl { | ||||||||||
| 20 | 0 | ▶ | stop_daemon($pidfile); | ||||||||
|
Subroutine
stop_impl: not called CC=1 SCAR=6.9
| |||||||||||
| 21 | } | ||||||||||
| 22 | |||||||||||
| 23 | sub status_impl { | ||||||||||
| 24 | 7 | ▶ | sleep 2; | ||||||||
|
Subroutine
status_impl: called CC=2 SCAR=6.9
| |||||||||||
| 25 | 7 | ▶ | if (check_daemon($pidfile)) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 26 | 2 | return 'running'; | |||||||||
| 27 | } | ||||||||||
| 28 | else { | ||||||||||
| 29 | 5 | return 'not running'; | |||||||||
| 30 | } | ||||||||||
| 31 | } | ||||||||||
| 32 | |||||||||||
| 33 | sub check_timeout { | ||||||||||
| 34 | 0 | ▶ | return 1; | ||||||||
|
Subroutine
check_timeout: not called CC=1 SCAR=6.9
| |||||||||||
| 35 | } | ||||||||||
| 36 | |||||||||||
| 37 | return __PACKAGE__->new; | ||||||||||