No output with -f when run in background after 1.6.6 #23

Closed
opened 2022-05-29 15:26:08 +00:00 by a-j-wood · 1 comment
a-j-wood commented 2022-05-29 15:26:08 +00:00 (Migrated from github.com)

Summary of correspondence:

On 5/29/22 07:06, Andrew Wood wrote:

Hello, thanks for your email.

I agree that "-f" should probably do what it says - force output - but
it gets complicated when writing to a terminal since writing to a terminal
when you're not the controlling process will generate a SIGTTOU which causes
it to stop.

Just to confirm, you are saying that with "-f" on 1.6.6, output is written
to stderr even when pv is in the background and stderr is a terminal, but in
newer versions no output is written in those circumstances?

Yes, that is correct. But more importantly, in 1.6.6 this case also
works without even needing "-f".

BTW, I added some options to my tool to work around this new behavior,
so it no longer affects me:
-G --no-group Don't create a new process group or determine PGIDs
-T, --no-tty Disable pseudo-terminal allocation

Thanks

Date: Sat, Apr 30, 2022 at 07:51:41PM +0000
Sent from: gray

Hi, I have a small issue with pv. I've been happily using it together with my own tool, but I recently added some features to my tool which made pv stop talking to me :-) I just made my tool public [1] and I see from your github page you're familiar with Perl, so I'll use my tool in the example. Let me know if you need a more minimal test case.

(#) this works as expected and prints a summary:
$ yes y | pv -pterl > /dev/null

(#) this will NOT print anything
$ yes y | run-stop-run pv -fpterl > /dev/null

I have tested against pv installed via MacPorts as well as direct from source. The manpage states the force options will output even if STDERR is not a terminal. But it doesn't mention that it won't output if it IS a terminal, but pv isn't the foreground process. Would it be possible to add an option (maybe really force -ff) that would make pv output if it's in the background and connected to stderr?

I modified pv_in_foreground() and it works fine for me when using pseudo-terminals (run-stop-run -t). Hmm, I just tested version 1.6.6 , and the default behavior does exactly what I want without even needing -f.

Thanks!

[1] https://github.com/gray/app-runstoprun

Summary of correspondence: On 5/29/22 07:06, Andrew Wood wrote: > Hello, thanks for your email. > > I agree that "-f" should probably do what it says - force output - but > it gets complicated when writing to a terminal since writing to a terminal > when you're not the controlling process will generate a SIGTTOU which causes > it to stop. > > Just to confirm, you are saying that with "-f" on 1.6.6, output is written > to stderr even when pv is in the background and stderr is a terminal, but in > newer versions no output is written in those circumstances? Yes, that is correct. But more importantly, in 1.6.6 this case also works without even needing "-f". BTW, I added some options to my tool to work around this new behavior, so it no longer affects me: -G --no-group Don't create a new process group or determine PGIDs -T, --no-tty Disable pseudo-terminal allocation Thanks > > Date: Sat, Apr 30, 2022 at 07:51:41PM +0000 >> Sent from: gray >> >> Hi, I have a small issue with pv. I've been happily using it together with my own tool, but I recently added some features to my tool which made pv stop talking to me :-) I just made my tool public [1] and I see from your github page you're familiar with Perl, so I'll use my tool in the example. Let me know if you need a more minimal test case. >> >> (#) this works as expected and prints a summary: >> $ yes y | pv -pterl > /dev/null >> >> (#) this will NOT print anything >> $ yes y | run-stop-run pv -fpterl > /dev/null >> >> I have tested against pv installed via MacPorts as well as direct from source. The manpage states the force options will output even if STDERR is not a terminal. But it doesn't mention that it won't output if it IS a terminal, but pv isn't the foreground process. Would it be possible to add an option (maybe really force -ff) that would make pv output if it's in the background and connected to stderr? >> >> I modified pv_in_foreground() and it works fine for me when using pseudo-terminals (run-stop-run -t). Hmm, I just tested version 1.6.6 , and the default behavior does exactly what I want without even needing -f. >> >> Thanks! >> >> [1] https://github.com/gray/app-runstoprun
a-j-wood commented 2023-07-16 21:00:26 +00:00 (Migrated from github.com)

Hello @gray

The "--force" option wasn't really working properly at all. The latest code in git (which will be in the next release after 1.6.20) should correct this.

Hello @gray The "`--force`" option wasn't really working properly at all. The latest code in git (which will be in the next release after 1.6.20) should correct this.
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: a-j-wood/pv#23
There is no content yet.