From: Eric Wong Date: Tue, 23 Mar 2021 11:48:06 +0000 (+0000) Subject: lei: persistent workers (lei_store) run in / X-Git-Tag: v1.7.0~924 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=05872a1ba3a01bdcd81402f37b3bf9c477f7c9fc;p=public-inbox.git lei: persistent workers (lei_store) run in / Since each lei->event_step can change the directory of lei-daemon, we need to ensure the lei_store runs in a directory that is stable. --- diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm index 17ca637e..d3ac19b2 100644 --- a/lib/PublicInbox/LEI.pm +++ b/lib/PublicInbox/LEI.pm @@ -453,6 +453,7 @@ sub _lei_atfork_child { my ($self, $persist) = @_; # we need to explicitly close things which are on stack if ($persist) { + chdir '/' or die "chdir(/): $!"; my @io = delete @$self{qw(0 1 2 sock)}; unless ($self->{oneshot}) { close($_) for @io;