diff options
author | Eric Wong <e@80x24.org> | 2021-04-02 05:42:54 -0400 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-04-02 17:03:44 -0400 |
commit | db56b898582789a0962e82b2c3cff56dd110d951 (patch) | |
tree | 209885539c8b7185ad1a1bbebddf2c93d15f6c9f /lib/PublicInbox | |
parent | 883db1e765b9fd0af7ed50b8c5df5527f566f0ba (diff) | |
download | public-inbox-db56b898582789a0962e82b2c3cff56dd110d951.tar.gz |
I completely forgot about git-credential prompting when making lei background the client process for MUA. Now it backgrounds itself only for the MUA when no FDs are passed, since the MUA is the final command run. Otherwise, it relies on FD passing as before. Fixes: c790a75439f3a1db ("script/lei: background ourselves on MUA/pager exec")
Diffstat (limited to 'lib/PublicInbox')
-rw-r--r-- | lib/PublicInbox/LEI.pm | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm index 69d48bd1..f9361c68 100644 --- a/lib/PublicInbox/LEI.pm +++ b/lib/PublicInbox/LEI.pm @@ -839,7 +839,13 @@ sub start_mua { if (my $sock = $self->{sock}) { # lei(1) client process runs it send($sock, exec_buf(\@cmd, {}), MSG_EOR); } elsif ($self->{oneshot}) { - $self->{"pid.$self.$$"}->{spawn(\@cmd)} = \@cmd; + my $pid = fork // die "fork: $!"; + if ($pid > 0) { # original process + exec(@cmd); + warn "exec @cmd: $!\n"; + POSIX::_exit(1); + } + POSIX::setsid() > 0 or die "setsid: $!"; } if ($self->{lxs} && $self->{au_done}) { # kick wait_startq syswrite($self->{au_done}, 'q' x ($self->{lxs}->{jobs} // 0)); |