man page dd - Sending USR1 signal
Bug #1054502 reported by
Decembry Quentin
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
coreutils (Ubuntu) |
Confirmed
|
Low
|
Unassigned |
Bug Description
I read this in the man page dd
Sending a USR1 signal to a running `dd' process makes it print I/O statistics to standard error and then resume copying.
$ dd if=/dev/zero of=/dev/null& pid=$!
$ kill -USR1 $pid; sleep 1; kill $pid
But when I tried 'kill -USR1 $pid; sleep 1; kill $pid', dd didn't resume.
I correct it with
kill -USR1 $pid; sleep 1; kill -CONT $pid
I'm not sure it could be concidered as bug but the man page isn't correct and it should be corrected
tags: | added: manpage |
To post a comment you must log in.
That example certainly isn't clear.
I don't think you need the kill -CONT, as far as I can tell the -USR1 will display the info and just carry on without
any other requirement.
So it's not obvious to me what the kill $pid in the original example is supposed to do, if you look at the info page
for dd it uses a more complex example that makes some more sense:
Sending an `INFO' signal to a running `dd' process makes it print
I/O statistics to standard error and then resume copying. In the
example below, `dd' is run in the background to copy 10 million blocks.
The `kill' command makes it output intermediate I/O statistics, and
when `dd' completes normally or is killed by the `SIGINT' signal, it
outputs the final statistics.
$ dd if=/dev/zero of=/dev/null count=10MB & pid=$!
$ kill -s INFO $pid; wait $pid
3385223+0 records in
3385223+0 records out
1733234176 bytes (1.7 GB) copied, 6.42173 seconds, 270 MB/s
10000000+0 records in
10000000+0 records out
5120000000 bytes (5.1 GB) copied, 18.913 seconds, 271 MB/s
On systems lacking the `INFO' signal `dd' responds to the `USR1'
signal instead, unless the `POSIXLY_CORRECT' environment variable is
set.
It's possible the kill $pid in the example is just there to kill off the backgrounded dd.
Confirming because at the very least the example is confusing.