dd dies on SIGUSR1
jhell at DataIX.net
Wed Mar 23 02:41:49 UTC 2011
-----BEGIN PGP SIGNED MESSAGE-----
On Tue, 22 Mar 2011 16:01, utisoft@ wrote:
> On 22 March 2011 18:16, David Schultz <das at freebsd.org> wrote:
>> On Tue, Mar 22, 2011, Chris Rees wrote:
>>> Since POSIX has SIGUSR as undefined, I think it's a POLA violation
>>> to have processes die when provided.
>> Quite the contrary: The default behavior of SIGUSR1 on FreeBSD
>> follows both POSIX and historical precedent, so changing it would
>> be a violation of POLA. Terminating the process is also the
>> default on Linux.
> However... I still think that because no-one in their right mind would
> use SIGUSR to terminate a program it's pointless for it to happen,
> and can only cause annoyance.
> People want to hold onto historical behaviour for no good reason, and
> I feel that this is one of these occasions. There is no reason for it
> apart from 'that's how it always has been [because no-one's
> complained]'. I also disagree that it 'follows' POSIX, POLA *IMO* for
> undefined behaviour is generally do nothing or report an error.
>> Linux dd's interpretation of SIGUSR1 seems rather poorly
>> considered, since as you note, utilities that don't handle it will
>> simply die unexpectedly. However, it certainly wouldn't hurt to
>> patch FreeBSD's dd to handle SIGUSR1 the same way as SIGINFO.
> Could the original patch in the PR be good enough then?
> Thank you for the thoughts.
> I'm sorry if I seem to be ranting, and I fully understand if my
> proposal of changing the default of USR1 is rejected completely; I
> just wanted to have a reasoned discussion.
> David, if you think the original patch (which does what your last
> paragraph says) is OK then feel free to take that as the Fix.
No offense but there has been plenty of reasoning here just given in your
very own message at the top. I can probably count the number of times that
I have had to actually had to use -USR1 & -USR2 on two hands. The times
that I have was when it was purposely programmed into something and more
than likely on a Linux machine and documented in the manual page or
somewhere on the authors site.
Assuming -USR[N] will get you -INFO does not mean the utilities you were
using were incorrect and needed to be changed. It means you need to change
your aspect of the portability of your syntax. Some systems go to far to
keep the end-user from shooting them self in the foot and this would be
one of those cases.
If a program receives a signal it should do *something* if it has nothing
to do then it should *terminate*. The author of said software here gave it
nothing else to do, therefore it terminates...
-----BEGIN PGP SIGNATURE-----
Comment: THIS SOFTWARE AND/OR CONTENTS IS PROVIDED BY THE AUTHOR ``AS IS'' AND
Comment: ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Comment: IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
Comment: PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
Comment: DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Comment: DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
Comment: OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
Comment: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
Comment: STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
Comment: IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
Comment: POSSIBILITY OF SUCH DAMAGE.
-----END PGP SIGNATURE-----
More information about the freebsd-standards