| line |
true |
false |
branch |
|
23
|
0 |
49 |
@_ == 1 ? : |
|
27
|
49 |
0 |
unless defined $opts->{'interval'} |
|
40
|
41 |
8 |
if not ref $ports and defined $ports |
|
42
|
6 |
43 |
if not ref $paths and defined $paths |
|
45
|
0 |
49 |
unless $opts->{'exec'} and ref $opts->{'exec'} eq 'ARRAY' |
|
49
|
4 |
45 |
if defined $opts->{'envdir'} |
|
51
|
12 |
37 |
if defined $opts->{'enable_auto_restart'} |
|
53
|
12 |
37 |
if defined $opts->{'kill_old_delay'} |
|
55
|
6 |
43 |
if defined $opts->{'auto_restart_interval'} |
|
63
|
0 |
49 |
if ($opts->{'log_file'}) |
|
64
|
0 |
0 |
if ($opts->{'log_file'} =~ /^\s*\|\s*/s) { } |
|
66
|
0 |
0 |
unless open $logfh, '|-', $cmd |
|
70
|
0 |
0 |
unless open $logfh, '>>', $opts->{'log_file'} |
|
95
|
39 |
2 |
if ($hostport =~ /^\s*(u?)(\d+)(?:\s*=(\d+))?\s*$/) { } |
|
|
2 |
0 |
elsif ($hostport =~ /^\s*(?:\[\s*|)([^\]]*)\s*(?:\]\s*|):\s*(u?)(\d+)(?:\s*=(\d+))?\s*$/) { } |
|
98
|
2 |
37 |
if $1 |
|
105
|
2 |
0 |
if $2 |
|
107
|
0 |
2 |
if ($host =~ /:/) { } |
|
112
|
0 |
0 |
unless my $addr = Socket::inet_pton(10, $host) |
|
117
|
0 |
0 |
if ($@) |
|
131
|
0 |
2 |
unless my $addr = gethostbyname $host |
|
138
|
0 |
41 |
unless socket my $sock, $domain, $socktype, 0 |
|
142
|
0 |
41 |
unless bind $sock, $sa |
|
144
|
37 |
4 |
if ($socktype != 2) |
|
146
|
0 |
37 |
unless listen $sock, $opts->{'backlog'} |
|
148
|
0 |
41 |
unless fcntl $sock, 2, my $flags = '' |
|
150
|
2 |
39 |
if (defined $fd) { } |
|
151
|
0 |
2 |
unless POSIX::dup2($sock->fileno, $fd) |
|
168
|
0 |
6 |
if (-S $path) |
|
170
|
0 |
0 |
unless unlink $path |
|
177
|
0 |
6 |
unless my $sock = 'IO::Socket::UNIX'->new('Listen', $opts->{'backlog'}, 'Local', $path) |
|
180
|
0 |
6 |
unless fcntl $sock, 2, my $flags = '' |
|
199
|
0 |
40 |
unless open my $tmpfh, '>', $tmpfn |
|
206
|
33 |
7 |
$current_worker ? : |
|
212
|
0 |
40 |
unless rename $tmpfn, $opts->{'status_file'} |
|
214
|
22 |
27 |
$opts->{'status_file'} ? : |
|
217
|
0 |
49 |
if ($logfh) |
|
220
|
0 |
0 |
unless open STDOUT, '>&=', $logfh |
|
222
|
0 |
0 |
unless open STDERR, '>&=', $logfh |
|
229
|
8 |
41 |
if ($opts->{'daemonize'}) |
|
231
|
0 |
8 |
unless defined $pid |
|
233
|
2 |
6 |
if ($pid != 0) |
|
240
|
0 |
6 |
unless defined $pid |
|
242
|
2 |
4 |
if ($pid != 0) |
|
247
|
4 |
0 |
unless (grep /=0$/, @sockenv) |
|
249
|
0 |
4 |
unless open STDIN, '<', '/dev/null' |
|
256
|
41 |
4 |
unless $opts->{'pid_file'} |
|
258
|
0 |
4 |
unless open my $fh, '>', $opts->{'pid_file'} |
|
259
|
0 |
4 |
unless flock $fh, 2 |
|
266
|
0 |
2 |
unless unlink $opts->{'pid_file'} |
|
278
|
0 |
78 |
unless defined $pid |
|
280
|
29 |
49 |
if ($pid == 0) |
|
283
|
2 |
27 |
if (defined $opts->{'dir'}) |
|
284
|
0 |
2 |
unless chdir $opts->{'dir'} |
|
292
|
39 |
10 |
if (grep {$_ ne 'HUP';} @signals_received or waitpid($pid, 1) <= 0) |
|
308
|
32 |
40 |
if ($block and $ENV{'ENABLE_AUTO_RESTART'}) { } |
|
321
|
16 |
0 |
$sig eq 'TERM' ? : |
|
329
|
16 |
0 |
if (my(@r) = _wait3(1)) |
|
349
|
32 |
40 |
if $ENV{'ENABLE_AUTO_RESTART'} |
|
351
|
12 |
60 |
if (@r) |
|
353
|
2 |
10 |
if ($died_worker == $current_worker) { } |
|
366
|
17 |
44 |
if ($sig eq 'HUP') { } |
|
|
28 |
16 |
elsif ($sig eq 'ALRM') { } |
|
376
|
30 |
8 |
if (not $restart and $ENV{'ENABLE_AUTO_RESTART'}) |
|
379
|
4 |
26 |
if ($elapsed_since_restart >= $auto_restart_interval and not %old_workers) { } |
|
|
0 |
26 |
elsif ($elapsed_since_restart >= $auto_restart_interval * 2) { } |
|
388
|
21 |
34 |
if ($restart) |
|
392
|
10 |
0 |
if (%old_workers) { } |
|
397
|
0 |
6 |
$ENV{'ENABLE_AUTO_RESTART'} ? : |
|
|
4 |
6 |
defined $ENV{'KILL_OLD_DELAY'} ? : |
|
398
|
4 |
6 |
if ($kill_old_delay != 0) |
|
414
|
0 |
0 |
@_ == 1 ? : |
|
418
|
0 |
0 |
unless $opts->{'pid_file'} and $opts->{'status_file'} |
|
423
|
0 |
0 |
unless open my $fh, '<', $opts->{'pid_file'} |
|
432
|
0 |
0 |
unless open my $fh, '<', $opts->{'status_file'} |
|
435
|
0 |
0 |
if ($line =~ /^(\d+):/) |
|
444
|
0 |
0 |
unless my(@gens) = &$get_generations() |
|
450
|
0 |
0 |
unless kill 'HUP', $pid |
|
456
|
0 |
0 |
if scalar @gens == 1 and $gens[0] == $wait_for |
|
462
|
0 |
2 |
@_ == 1 ? : |
|
466
|
0 |
2 |
unless $opts->{'pid_file'} |
|
470
|
0 |
2 |
unless open my $fh, '+<', $opts->{'pid_file'} |
|
480
|
0 |
2 |
unless kill 'TERM', $pid |
|
484
|
0 |
2 |
unless flock $fh, 2 |
|
491
|
0 |
0 |
unless defined $ENV{'SERVER_STARTER_PORT'} |
|
500
|
108 |
13 |
unless defined $dn and -d $dn |
|
502
|
0 |
13 |
unless opendir $d, $dn |
|
505
|
26 |
9 |
if $n =~ /^\./ |
|
506
|
0 |
9 |
unless open my $fh, '<', "$dn/$n" |
|
508
|
9 |
0 |
if defined $v |
|
521
|
56 |
7 |
if $sighandler_should_die |
|
529
|
85 |
7 |
if ($block) { } |
|
534
|
0 |
85 |
if $sighandler_got_sig |
|
538
|
56 |
0 |
if ($pid == -1 and $@) |
|
544
|
29 |
63 |
$pid > 0 ? : |