* [PATCH 4/9] lei: write daemon errors to the sock directory
2021-01-19 9:34 5% [PATCH 0/9] lei bugfixes and error handling Eric Wong
@ 2021-01-19 9:34 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2021-01-19 9:34 UTC (permalink / raw)
To: meta
Most everything should be captured by the __WARN__ handlers and
routed to syslog, but it appears Perl may write to stderr in
some emergency cases, as can libc or other libraries. Just
point it to a small file that's cleared on reboot.
---
lib/PublicInbox/LEI.pm | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm
index 802d2cd9..e4f8bedb 100644
--- a/lib/PublicInbox/LEI.pm
+++ b/lib/PublicInbox/LEI.pm
@@ -830,7 +830,9 @@ sub lazy_start {
require PublicInbox::Listener;
require PublicInbox::EOFpipe;
(-p STDOUT) or die "E: stdout must be a pipe\n";
- open(STDIN, '+<', '/dev/null') or die "redirect stdin failed: $!";
+ my ($err) = ($path =~ m!\A(.+?/)[^/]+\z!);
+ $err .= 'errors.log';
+ open(STDIN, '+>>', $err) or die "open($err): $!";
POSIX::setsid() > 0 or die "setsid: $!";
my $pid = fork // die "fork: $!";
return if $pid;
^ permalink raw reply related [relevance 7%]
* [PATCH 0/9] lei bugfixes and error handling
@ 2021-01-19 9:34 5% Eric Wong
2021-01-19 9:34 7% ` [PATCH 4/9] lei: write daemon errors to the sock directory Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2021-01-19 9:34 UTC (permalink / raw)
To: meta
1/9 could have some potential when we start handling remotes,
3/9 seems necessary, unfortunately :<
4/9 helped find some bugs,
9/9 is incomplete, but that describes everything :<
Eric Wong (9):
lei q: start ->mset while query_prepare runs
lei q: fix SIGPIPE handling from lei2mail workers
lei q: do not spawn MUA early
lei: write daemon errors to the sock directory
lei q: fix augment of compressed mailboxes
lei_overview: do not write if $lei->{1} is gone
t/lei: fix double-running of socket test with oneshot
lei: test some likely errors due to misuse
lei_overview: start implementing format detection
lib/PublicInbox/LEI.pm | 22 ++++---
lib/PublicInbox/LeiOverview.pm | 25 ++++++--
lib/PublicInbox/LeiToMail.pm | 39 +++++++-----
lib/PublicInbox/LeiXSearch.pm | 105 +++++++++++++++++++++++----------
lib/PublicInbox/Spawn.pm | 2 +-
t/lei.t | 75 +++++++++++++++--------
t/lei_to_mail.t | 4 +-
xt/lei-sigpipe.t | 29 +++++----
8 files changed, 200 insertions(+), 101 deletions(-)
^ permalink raw reply [relevance 5%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2021-01-19 9:34 5% [PATCH 0/9] lei bugfixes and error handling Eric Wong
2021-01-19 9:34 7% ` [PATCH 4/9] lei: write daemon errors to the sock directory Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).