]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei: persistent workers (lei_store) run in /
authorEric Wong <e@80x24.org>
Tue, 23 Mar 2021 11:48:06 +0000 (11:48 +0000)
committerEric Wong <e@80x24.org>
Wed, 24 Mar 2021 01:33:26 +0000 (01:33 +0000)
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.

lib/PublicInbox/LEI.pm

index 17ca637eb304fd6d2fc246e38976aea4bd60319d..d3ac19b2bb7b71b92eec74e78a27b82368f2d6a0 100644 (file)
@@ -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;