Branch Coverage

blib/lib/System/Daemon.pm
Criterion Covered Total %
branch 28 58 48.2


line true false branch
24 0 3 if ($params{'user'})
28 0 3 if ($params{'group'})
32 3 0 if ($params{'pidfile'})
36 0 3 if ($params{'new'})
40 0 3 if ($params{'mkdir'})
44 0 3 if ($params{'procname'})
48 0 3 if (exists $params{'daemonize'})
52 0 3 if ($params{'cleanup_on_destroy'})
63 0 16 unless $self->{'pidfile'}
65 0 16 $self->{'new'} ? :
71 0 3 unless ($self->{'daemon_data'}{'daemonize'})
84 0 1 if ($dd->{'user'} or $dd->{'group'})
88 0 0 unless (System::Daemon::Utils::validate_user_and_group('user', $dd->{'user'}, 'group', $dd->{'group'}))
93 1 0 if ($self->pidfile)
96 0 1 if $dd->{'mkdir'}
98 1 0 if ($self->pidfile)
99 0 1 unless $self->ok_pid
100 1 0 if ($self->pidfile)
104 0 1 unless ($got_lock)
116 0 1 if ($dd->{'user'} or $dd->{'group'})
123 0 1 if ($dd->{'procname'})
127 0 1 if ($dd->{'cleanup_on_destroy'})
154 0 1 unless $pidfile
156 0 1 unless (System::Daemon::Utils::pid_init($self->pidfile))
161 1 0 unless ($pid = System::Daemon::Utils::read_pid($pidfile))
180 1 1 if ($pid ne $self->{'original_pid'})
184 2 0 if ($self->pidfile)
185 0 2 if (-e $self->pidfile . '.new') { }
186 0 0 unless rename $self->pidfile . '.new', $self->pidfile