about summary refs log tree commit homepage
path: root/lib/PublicInbox/Daemon.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2022-08-01 21:24:45 +0000
committerEric Wong <e@80x24.org>2022-08-02 19:20:13 +0000
commit03e3c3f9bb62083e2f9dd4eb1ae1506901d2eae0 (patch)
tree91ec1ff1bb15bd43cc91ad4ff3831e8199f6601d /lib/PublicInbox/Daemon.pm
parent3e6f8bf5a205fa1e0ad9d52cd13fa91f20f79018 (diff)
downloadpublic-inbox-03e3c3f9bb62083e2f9dd4eb1ae1506901d2eae0.tar.gz
These are helpful for diagnosing configuration problems,
as well as a bug (to be fixed in the following commit).
Diffstat (limited to 'lib/PublicInbox/Daemon.pm')
-rw-r--r--lib/PublicInbox/Daemon.pm9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/PublicInbox/Daemon.pm b/lib/PublicInbox/Daemon.pm
index 87a359e7..3264bb6c 100644
--- a/lib/PublicInbox/Daemon.pm
+++ b/lib/PublicInbox/Daemon.pm
@@ -129,6 +129,7 @@ sub load_mod ($;$) {
                         die "multiple psgi= options specified\n" if @$p > 1;
                         check_absolute('psgi=', $p->[0]) if $daemonize;
                         $tlsd->{psgi} = $p->[0];
+                        warn "# $scheme://$addr psgi=$p->[0]\n";
                 }
         }
         for my $f (@paths) {
@@ -138,6 +139,7 @@ sub load_mod ($;$) {
                 $p = File::Spec->canonpath($p->[0]);
                 open_log_path(my $fh, $p);
                 $tlsd->{$f} = $logs{$p} = $fh;
+                warn "# $scheme://$addr $f=$p\n";
         }
         \%xn;
 }
@@ -247,8 +249,10 @@ EOF
                 warn "error binding $l: $! ($@)\n" unless $s;
                 umask $prev;
                 if ($s) {
-                        $listener_names->{sockname($s)} = $s;
                         $s->blocking(0);
+                        my $k = sockname($s);
+                        warn "# bound $scheme://$k\n";
+                        $listener_names->{$k} = $s;
                         push @listeners, $s;
                 }
         }
@@ -434,11 +438,12 @@ sub inherit ($) {
                 if (my $k = sockname($s)) {
                         my $prev_was_blocking = $s->blocking(0);
                         warn <<"" if $prev_was_blocking;
-Inherited socket (fd=$fd) is blocking, making it non-blocking.
+Inherited socket ($k fd=$fd) is blocking, making it non-blocking.
 Set 'NonBlocking = true' in the systemd.service unit to avoid stalled
 processes when multiple service instances start.
 
                         $listener_names->{$k} = $s;
+                        warn "# inherited $k fd=$fd\n";
                         push @rv, $s;
                 } else {
                         warn "failed to inherit fd=$fd (LISTEN_FDS=$fds)";