+{
+ my $conn = conn_for($alt, 'alt PSGI path');
+ $conn->write("GET / HTTP/1.0\r\n\r\n");
+ $conn->read(my $buf, 4096);
+ like($buf, qr!^/path/to/alt\z!sm,
+ 'alt.psgi loaded on alt socket with correct env');
+
+ $conn = conn_for($sock, 'default PSGI path');
+ $conn->write("GET /PI_CONFIG HTTP/1.0\r\n\r\n");
+ $conn->read($buf, 4096);
+ like($buf, qr!^/dev/null\z!sm,
+ 'default PSGI on original socket');
+ my $log = capture("$tmpdir/alt.err");
+ ok(grep(/ALT/, @$log), 'alt psgi.errors written to');
+ $log = capture($err);
+ ok(!grep(/ALT/, @$log), 'STDERR not written to');
+ is(unlink($err, "$tmpdir/alt.err"), 2, 'unlinked stderr and alt.err');
+
+ $td->kill('USR1'); # trigger reopen_logs
+}
+