From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 26 06:30:49 2015 Received: (at submit) by debbugs.gnu.org; 26 Oct 2015 10:30:49 +0000 Received: from localhost ([127.0.0.1]:38505 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zqf3A-0000yX-Tk for submit@debbugs.gnu.org; Mon, 26 Oct 2015 06:30:49 -0400 Received: from eggs.gnu.org ([208.118.235.92]:52650) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zqf37-0000yO-Oz for submit@debbugs.gnu.org; Mon, 26 Oct 2015 06:30:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zqf36-000562-Ll for submit@debbugs.gnu.org; Mon, 26 Oct 2015 06:30:45 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:36409) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zqf36-00055y-Hi for submit@debbugs.gnu.org; Mon, 26 Oct 2015 06:30:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34423) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zqf35-0007wn-Ae for bug-coreutils@gnu.org; Mon, 26 Oct 2015 06:30:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zqf31-00055f-5h for bug-coreutils@gnu.org; Mon, 26 Oct 2015 06:30:43 -0400 Received: from hz1.yz.to ([178.63.61.147]:45835) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zqf30-00055R-Tt for bug-coreutils@gnu.org; Mon, 26 Oct 2015 06:30:39 -0400 Received: from [172.17.6.34] (ww2.tbz-pariv.de [194.113.71.71]) by hz1.yz.to (Postfix) with ESMTPSA id 7333D817590E for ; Mon, 26 Oct 2015 11:30:33 +0100 (CET) To: bug-coreutils@gnu.org From: =?UTF-8?Q?Thomas_G=c3=bcttler?= Subject: timeout: Feature Request: --verbose ==> output if timeout was reached Message-ID: <562E00CC.7060307@thomas-guettler.de> Date: Mon, 26 Oct 2015 11:30:36 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) About commandline tool "timeout": Start COMMAND, and kill it if still running after DURATION. A new team mate wasted some time to debug why a process was killed with signal 15. I think it would be nice to have an --verbose option, and a some text which explains why the signal was send. This is important in environments where the one who reads the script failures is not the same person who writes the script. What do you think? Example: Old: user@host:~$ timeout 1s ping localhost PING localhost (127.0.0.1) 56(84) bytes of data. 64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.078 ms New: user@host:~$ timeout 1s ping localhost PING localhost (127.0.0.1) 56(84) bytes of data. 64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.078 ms ** Process "ping localhost" was killed with signal 16 since the timeout of 1s was reached. ** -- Thomas Guettler http://www.thomas-guettler.de/ From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 26 07:44:33 2015 Received: (at 21760) by debbugs.gnu.org; 26 Oct 2015 11:44:33 +0000 Received: from localhost ([127.0.0.1]:38537 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZqgCW-0004LF-Sh for submit@debbugs.gnu.org; Mon, 26 Oct 2015 07:44:33 -0400 Received: from mail1.vodafone.ie ([213.233.128.43]:39671) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZqgCC-0004Km-Gu for 21760@debbugs.gnu.org; Mon, 26 Oct 2015 07:44:31 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnMFACURLlZtTLmV/2dsb2JhbABeKII8UoQfvU2DRoJXAoErTAEBAQEBAYELhDMBAQQjDwFWCw0LAgIFFgsCAgkDAgECAUUGAQwIAQGIMAGyKYVvjBMBLIEihFqFeYUUgmmBRQWWNpZShhqMZWOCDiAWgT8+h0wBAQE Received: from unknown (HELO localhost.localdomain) ([109.76.185.149]) by mail1.vodafone.ie with ESMTP; 26 Oct 2015 11:44:10 +0000 Subject: Re: bug#21760: timeout: Feature Request: --verbose ==> output if timeout was reached To: =?UTF-8?Q?Thomas_G=c3=bcttler?= , 21760@debbugs.gnu.org References: <562E00CC.7060307@thomas-guettler.de> From: =?UTF-8?Q?P=c3=a1draig_Brady?= Message-ID: <562E120A.3060601@draigBrady.com> Date: Mon, 26 Oct 2015 11:44:10 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <562E00CC.7060307@thomas-guettler.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 21760 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) tag 21760 wontfix close 21760 stop On 26/10/15 10:30, Thomas Güttler wrote: > About commandline tool "timeout": Start COMMAND, and kill it if still running after DURATION. > > A new team mate wasted some time to debug why > a process was killed with signal 15. > > I think it would be nice to have an --verbose option, and a some > text which explains why the signal was send. > > This is important in environments where the one who reads > the script failures is not the same person who writes the script. > > What do you think? > > Example: > > Old: > > user@host:~$ timeout 1s ping localhost > PING localhost (127.0.0.1) 56(84) bytes of data. > 64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.078 ms > > New: > > user@host:~$ timeout 1s ping localhost > PING localhost (127.0.0.1) 56(84) bytes of data. > 64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.078 ms > ** Process "ping localhost" was killed with signal 16 since the timeout of 1s was reached. ** I've not sure there is enough distinct actions within timeout(1) to warrant --verbose? How about doing this in the script? timeout 1s ping localhost test $? = 124 && echo { 'ping timed out'; exit 1; } thanks, Pádraig. From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 26 10:26:18 2015 Received: (at 21760) by debbugs.gnu.org; 26 Oct 2015 14:26:18 +0000 Received: from localhost ([127.0.0.1]:39298 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zqij3-0008L9-SZ for submit@debbugs.gnu.org; Mon, 26 Oct 2015 10:26:18 -0400 Received: from hz1.yz.to ([178.63.61.147]:37688) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zqij1-0008L0-9H for 21760@debbugs.gnu.org; Mon, 26 Oct 2015 10:26:16 -0400 Received: from [172.17.6.34] (ww2.tbz-pariv.de [194.113.71.71]) by hz1.yz.to (Postfix) with ESMTPSA id 5090B8175914; Mon, 26 Oct 2015 15:26:10 +0100 (CET) Subject: Re: bug#21760: timeout: Feature Request: --verbose ==> output if timeout was reached To: =?UTF-8?Q?P=c3=a1draig_Brady?= , 21760@debbugs.gnu.org References: <562E00CC.7060307@thomas-guettler.de> <562E120A.3060601@draigBrady.com> From: =?UTF-8?Q?Thomas_G=c3=bcttler?= Message-ID: <562E3805.2030704@thomas-guettler.de> Date: Mon, 26 Oct 2015 15:26:13 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <562E120A.3060601@draigBrady.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 21760 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Am 26.10.2015 um 12:44 schrieb Pádraig Brady: > > I've not sure there is enough distinct actions within timeout(1) to warrant --verbose? > How about doing this in the script? > > timeout 1s ping localhost > test $? = 124 && echo { 'ping timed out'; exit 1; } > The issue was already closed with "wontfix". This leads me to the conclusion that your are not interested in my answer. Was your "How about doing this in the script?" really a question? -- Thomas Guettler http://www.thomas-guettler.de/ From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 26 11:52:02 2015 Received: (at 21760) by debbugs.gnu.org; 26 Oct 2015 15:52:02 +0000 Received: from localhost ([127.0.0.1]:39338 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zqk42-0001uA-3N for submit@debbugs.gnu.org; Mon, 26 Oct 2015 11:52:02 -0400 Received: from mail1.vodafone.ie ([213.233.128.43]:64769) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zqk3z-0001tk-Of for 21760@debbugs.gnu.org; Mon, 26 Oct 2015 11:52:00 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnQGAAdLLlZtTLmV/2dsb2JhbABeKII8UoMLvmWDRoJXAoExTAEBAQEBAYELhDMBAQQjDwFWCw0LAgIFFgsCAgkDAgECAUUGAQwIAQGIMAGyVIVvjBgBLIEihFqFeYUUgmmBRQWWNo57h1eGGoh1g3BjgkSBPz6HTAEBAQ Received: from unknown (HELO localhost.localdomain) ([109.76.185.149]) by mail1.vodafone.ie with ESMTP; 26 Oct 2015 15:51:57 +0000 Subject: Re: bug#21760: timeout: Feature Request: --verbose ==> output if timeout was reached To: =?UTF-8?Q?Thomas_G=c3=bcttler?= , 21760@debbugs.gnu.org References: <562E00CC.7060307@thomas-guettler.de> <562E120A.3060601@draigBrady.com> <562E3805.2030704@thomas-guettler.de> From: =?UTF-8?Q?P=c3=a1draig_Brady?= Message-ID: <562E4C1D.6010402@draigBrady.com> Date: Mon, 26 Oct 2015 15:51:57 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <562E3805.2030704@thomas-guettler.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 21760 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On 26/10/15 14:26, Thomas Güttler wrote: > > > Am 26.10.2015 um 12:44 schrieb Pádraig Brady: >> >> I've not sure there is enough distinct actions within timeout(1) to warrant --verbose? >> How about doing this in the script? >> >> timeout 1s ping localhost >> test $? = 124 && echo { 'ping timed out'; exit 1; } >> > > The issue was already closed with "wontfix". This leads me to the > conclusion that your are not interested in my answer. > > Was your "How about doing this in the script?" really a question? We can always reopen if necessary. I closed as wontfix for now as the above is a strong suggestion. Generally one needs to handle the timeout in various ways, and printing a diagnostic is just one of those. thanks, Pádraig From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 26 14:36:23 2015 Received: (at 21760) by debbugs.gnu.org; 26 Oct 2015 18:36:23 +0000 Received: from localhost ([127.0.0.1]:39379 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zqmd5-0005lB-9X for submit@debbugs.gnu.org; Mon, 26 Oct 2015 14:36:23 -0400 Received: from hz1.yz.to ([178.63.61.147]:44606) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zqmck-0005kI-DG for 21760@debbugs.gnu.org; Mon, 26 Oct 2015 14:36:21 -0400 Received: from [192.168.178.45] (i5E86DA60.versanet.de [94.134.218.96]) by hz1.yz.to (Postfix) with ESMTPSA id 394C7817D7B2; Mon, 26 Oct 2015 19:35:56 +0100 (CET) Subject: Re: bug#21760: timeout: Feature Request: --verbose ==> output if timeout was reached To: =?UTF-8?Q?P=c3=a1draig_Brady?= , 21760@debbugs.gnu.org References: <562E00CC.7060307@thomas-guettler.de> <562E120A.3060601@draigBrady.com> <562E3805.2030704@thomas-guettler.de> <562E4C1D.6010402@draigBrady.com> From: =?UTF-8?Q?Thomas_G=c3=bcttler?= Message-ID: <562E728D.4080301@thomas-guettler.de> Date: Mon, 26 Oct 2015 19:35:57 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:41.0) Gecko/20100101 Thunderbird/41.0 MIME-Version: 1.0 In-Reply-To: <562E4C1D.6010402@draigBrady.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 21760 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Am 26.10.2015 um 16:51 schrieb Pádraig Brady: > On 26/10/15 14:26, Thomas Güttler wrote: >> >> >> Am 26.10.2015 um 12:44 schrieb Pádraig Brady: >>> >>> I've not sure there is enough distinct actions within timeout(1) to warrant --verbose? >>> How about doing this in the script? >>> >>> timeout 1s ping localhost >>> test $? = 124 && echo { 'ping timed out'; exit 1; } >>> >> >> The issue was already closed with "wontfix". This leads me to the >> conclusion that your are not interested in my answer. >> >> Was your "How about doing this in the script?" really a question? > > We can always reopen if necessary. Who decides if it necessary or not? What needs to be done to reopen it? > I closed as wontfix for now as the above is a strong suggestion. > Generally one needs to handle the timeout in various ways, > and printing a diagnostic is just one of those. yes, you are right. This issue is about printing a message. If other ways are needed, then your above solution can be used as a skeleton. But this should be handled in different issues/bug-reports. Regards, Thomas Güttler -- http://www.thomas-guettler.de/ From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 26 15:50:19 2015 Received: (at 21760) by debbugs.gnu.org; 26 Oct 2015 19:50:20 +0000 Received: from localhost ([127.0.0.1]:39425 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zqnmd-0007VZ-32 for submit@debbugs.gnu.org; Mon, 26 Oct 2015 15:50:19 -0400 Received: from mail1.vodafone.ie ([213.233.128.43]:22931) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZqnmG-0007Ul-HK for 21760@debbugs.gnu.org; Mon, 26 Oct 2015 15:50:15 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkgGAHWDLlZtTLmV/2dsb2JhbABeKII8UlRvwC0hhXwCgThMAQEBAQEBgQuEMgEBAQMBIw8BVgsNCwICBRYLAgIJAwIBAgFFBgEMCAEBF4gNDAEIs0yFb4wiAQEIAQEBARsEgSKEWoV5hEJSgmmBRQWWNoUciV+HV4YaiHWDcGOCRIE/PjQBhxcBAQE Received: from unknown (HELO localhost.localdomain) ([109.76.185.149]) by mail1.vodafone.ie with ESMTP; 26 Oct 2015 19:49:55 +0000 Subject: Re: bug#21760: timeout: Feature Request: --verbose ==> output if timeout was reached To: =?UTF-8?Q?Thomas_G=c3=bcttler?= , 21760@debbugs.gnu.org References: <562E00CC.7060307@thomas-guettler.de> <562E120A.3060601@draigBrady.com> <562E3805.2030704@thomas-guettler.de> <562E4C1D.6010402@draigBrady.com> <562E728D.4080301@thomas-guettler.de> From: =?UTF-8?Q?P=c3=a1draig_Brady?= Message-ID: <562E83E2.1030102@draigBrady.com> Date: Mon, 26 Oct 2015 19:49:54 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <562E728D.4080301@thomas-guettler.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 21760 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On 26/10/15 18:35, Thomas Güttler wrote: > Am 26.10.2015 um 16:51 schrieb Pádraig Brady: >> On 26/10/15 14:26, Thomas Güttler wrote: >>> >>> >>> Am 26.10.2015 um 12:44 schrieb Pádraig Brady: >>>> >>>> I've not sure there is enough distinct actions within timeout(1) to warrant --verbose? >>>> How about doing this in the script? >>>> >>>> timeout 1s ping localhost >>>> test $? = 124 && echo { 'ping timed out'; exit 1; } I meant: test $? = 124 && { echo 'ping timed out' >&2; exit 1; } >>> The issue was already closed with "wontfix". This leads me to the >>> conclusion that your are not interested in my answer. >>> >>> Was your "How about doing this in the script?" really a question? >> >> We can always reopen if necessary. > > Who decides if it necessary or not? What needs to be done > to reopen it? This is an open process. bug control details are at: https://debbugs.gnu.org/server-control.html >> I closed as wontfix for now as the above is a strong suggestion. >> Generally one needs to handle the timeout in various ways, >> and printing a diagnostic is just one of those. > > yes, you are right. This issue is about printing a > message. If other ways are needed, then your > above solution can be used as a skeleton. But this > should be handled in different issues/bug-reports. Personally I don't think we need to distinguish these cases. cheers, Pádraig. From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 28 03:16:36 2015 Received: (at 21760) by debbugs.gnu.org; 28 Oct 2015 07:16:36 +0000 Received: from localhost ([127.0.0.1]:41128 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZrKyJ-0001M0-Se for submit@debbugs.gnu.org; Wed, 28 Oct 2015 03:16:36 -0400 Received: from hz1.yz.to ([178.63.61.147]:60876) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZrKxz-0001L9-NT for 21760@debbugs.gnu.org; Wed, 28 Oct 2015 03:16:34 -0400 Received: from [192.168.178.23] (i5E86CBE.versanet.de [94.134.203.14]) by hz1.yz.to (Postfix) with ESMTPSA id 65E32819FBBD for <21760@debbugs.gnu.org>; Wed, 28 Oct 2015 08:16:11 +0100 (CET) Subject: Re: bug#21760: timeout: Feature Request: --verbose ==> output if timeout was reached To: 21760@debbugs.gnu.org References: <562E00CC.7060307@thomas-guettler.de> <562E120A.3060601@draigBrady.com> <562E3805.2030704@thomas-guettler.de> <562E4C1D.6010402@draigBrady.com> <562E728D.4080301@thomas-guettler.de> <562E83E2.1030102@draigBrady.com> From: =?UTF-8?Q?Thomas_G=c3=bcttler?= Message-ID: <5630763D.4000009@thomas-guettler.de> Date: Wed, 28 Oct 2015 08:16:13 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:41.0) Gecko/20100101 Thunderbird/41.0 MIME-Version: 1.0 In-Reply-To: <562E83E2.1030102@draigBrady.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 21760 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Am 26.10.2015 um 20:49 schrieb Pádraig Brady: > On 26/10/15 18:35, Thomas Güttler wrote: >> Am 26.10.2015 um 16:51 schrieb Pádraig Brady: >>> On 26/10/15 14:26, Thomas Güttler wrote: >>>> >>>> >>>> Am 26.10.2015 um 12:44 schrieb Pádraig Brady: >>>>> >>>>> I've not sure there is enough distinct actions within timeout(1) to warrant --verbose? >>>>> How about doing this in the script? >>>>> >>>>> timeout 1s ping localhost >>>>> test $? = 124 && echo { 'ping timed out'; exit 1; } > > I meant: > > test $? = 124 && { echo 'ping timed out' >&2; exit 1; } > >>>> The issue was already closed with "wontfix". This leads me to the >>>> conclusion that your are not interested in my answer. >>>> >>>> Was your "How about doing this in the script?" really a question? >>> >>> We can always reopen if necessary. >> >> Who decides if it necessary or not? What needs to be done >> to reopen it? > > This is an open process. > bug control details are at: > https://debbugs.gnu.org/server-control.html OK, now I know which software you use to handle the issues. Thank you. Since we both have different opinions, what to do next? Is there a escalation workflow guide line? Regards, Thomas Güttler -- http://www.thomas-guettler.de/ From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 28 06:00:27 2015 Received: (at 21760) by debbugs.gnu.org; 28 Oct 2015 10:00:27 +0000 Received: from localhost ([127.0.0.1]:41218 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZrNWt-0007QR-AD for submit@debbugs.gnu.org; Wed, 28 Oct 2015 06:00:27 -0400 Received: from mail2.vodafone.ie ([213.233.128.44]:45222) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZrNWq-0007QE-RL for 21760@debbugs.gnu.org; Wed, 28 Oct 2015 06:00:25 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ar4KAK2bMFZtTFO8/2dsb2JhbABeKII8UlRvwHAhgkCDOgKBO0wBAQEBAQGBC4Q2AQEEIw8BVgsNCwICBRYLAgIJAwIBAgFFBgEMCAEBiDABCLMThW+MFwEBCAEBAQEbBIEihFqFeYRFUoJpgUUFlj2FHIlhh1eGGoh4g3BjgkSBQD40AYV8AQEB Received: from unknown (HELO localhost.localdomain) ([109.76.83.188]) by mail2.vodafone.ie with ESMTP; 28 Oct 2015 10:00:23 +0000 Subject: Re: bug#21760: timeout: Feature Request: --verbose ==> output if timeout was reached To: =?UTF-8?Q?Thomas_G=c3=bcttler?= , 21760@debbugs.gnu.org References: <562E00CC.7060307@thomas-guettler.de> <562E120A.3060601@draigBrady.com> <562E3805.2030704@thomas-guettler.de> <562E4C1D.6010402@draigBrady.com> <562E728D.4080301@thomas-guettler.de> <562E83E2.1030102@draigBrady.com> <5630763D.4000009@thomas-guettler.de> From: =?UTF-8?Q?P=c3=a1draig_Brady?= Message-ID: <56309CB6.7050802@draigBrady.com> Date: Wed, 28 Oct 2015 10:00:22 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <5630763D.4000009@thomas-guettler.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 21760 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) reopen 21760 On 28/10/15 07:16, Thomas Güttler wrote: > Am 26.10.2015 um 20:49 schrieb Pádraig Brady: >> On 26/10/15 18:35, Thomas Güttler wrote: >>> Am 26.10.2015 um 16:51 schrieb Pádraig Brady: >>>> On 26/10/15 14:26, Thomas Güttler wrote: >>>>> >>>>> >>>>> Am 26.10.2015 um 12:44 schrieb Pádraig Brady: >>>>>> >>>>>> I've not sure there is enough distinct actions within timeout(1) to warrant --verbose? >>>>>> How about doing this in the script? >>>>>> >>>>>> timeout 1s ping localhost >>>>>> test $? = 124 && echo { 'ping timed out'; exit 1; } >> >> I meant: >> >> test $? = 124 && { echo 'ping timed out' >&2; exit 1; } >> >>>>> The issue was already closed with "wontfix". This leads me to the >>>>> conclusion that your are not interested in my answer. >>>>> >>>>> Was your "How about doing this in the script?" really a question? >>>> >>>> We can always reopen if necessary. >>> >>> Who decides if it necessary or not? What needs to be done >>> to reopen it? >> >> This is an open process. >> bug control details are at: >> https://debbugs.gnu.org/server-control.html > > OK, now I know which software you use to handle the issues. Thank you. > > Since we both have different opinions, what to do next? > > Is there a escalation workflow guide line? Reopened until someone else votes. thanks, Pádraig. From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 28 10:10:37 2015 Received: (at 21760) by debbugs.gnu.org; 28 Oct 2015 14:10:37 +0000 Received: from localhost ([127.0.0.1]:42600 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZrRQz-0002dY-22 for submit@debbugs.gnu.org; Wed, 28 Oct 2015 10:10:37 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:49903) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZrRQx-0002dP-LB for 21760@debbugs.gnu.org; Wed, 28 Oct 2015 10:10:36 -0400 Received: from [10.0.2.15] ([62.153.148.194]) by mrelayeu.kundenserver.de (mreue003) with ESMTPSA (Nemesis) id 0MWvXU-1ZwswA2XfI-00VxGM; Wed, 28 Oct 2015 15:10:34 +0100 Subject: Re: bug#21760: timeout: Feature Request: --verbose ==> output if timeout was reached To: =?UTF-8?Q?P=c3=a1draig_Brady?= , =?UTF-8?Q?Thomas_G=c3=bcttler?= , 21760@debbugs.gnu.org References: <562E00CC.7060307@thomas-guettler.de> <562E120A.3060601@draigBrady.com> <562E3805.2030704@thomas-guettler.de> <562E4C1D.6010402@draigBrady.com> <562E728D.4080301@thomas-guettler.de> <562E83E2.1030102@draigBrady.com> <5630763D.4000009@thomas-guettler.de> <56309CB6.7050802@draigBrady.com> From: Bernhard Voelker Message-ID: <5630D759.6050207@bernhard-voelker.de> Date: Wed, 28 Oct 2015 15:10:33 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <56309CB6.7050802@draigBrady.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:mmoKS1wul3DqaQCLPSFfOTLnlXq1ZVpPiGuEJfM3/7oZXjF5qtb FjYHmXuVfBXFVVhzxTycEy47xpGK2Jz5c0O6C4f1h+KjAqeUGzzaRRNh6UBPcsqmpJe1PNR epc8eSriVbPcsloF4D1hdr5Cqv/peuc99IuTYGI/dAb1sj0WOyEdWVIzm23zWDZ56BFY5oX G9pxgCrmaPdpb2YzYspSQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:V9CsdyOpKG4=:w1/+RjwfGr2VQWiMHQJMLi f2xKuZ+anlizponhar2u27uNtkOJ2wEhF69/mXvRXMCx7ViqEWfkmohabbn3q5B8cAJrBPXuW yPzuSC6nZaYQswX77JpsgdIjIjHl9gy1MYfz3AZWJB0aEE3sW00Ht7Ln4Gu7BJLcXk3ZP8qmU 6W+P4w7xzx8tx9JpTkguHvVhEnClexh0ks0CK7JbguBP1XPsVlz0M3G+qsfnRMqQpFDFRo5Kl v1t3n0IrJ1t5hyqDAGO/fs2fverzkdbNETfth1/1SZ4wMd+ulvJsx3od0IR4m3VFQ9h2Zz0TU 2tdN1YGu6q82pqC70Y1SU4cjOB51iZ8zr38OGUM9LaavA4kJiGYDthJwJtv0LrTub9GXkpgTC 3OcaWv31xBAyAmuIOoJqyNKNlQ2HudCyzIVdM/47W5Rv7tYEbXqFaepLKkMo96tMLbSUqp9hP 1CKwVmVMU2Gdwfc+IaQO/ukQgAKoGsnxdRWisOyZsFiWVWUF+joXBC6m1ZQE1Qz5exE1mAFjK hJ9cEeBUGpVehRZUIRrBwi2ObtxIdF1umQRpHYENy76wgB8YrthX1LN0htKofj4mWvIXdcdq8 3KXL8W38g+gYdbFJdLnJs8adzU0orMmEWVzsobCVaMq+cqRvFOGGrmUl+8T+ysLrTM1oCBE6p 20olX4jvJz/v8aO1Io8gu8QXf+wL++jcjDtzc6yiMdv0jIQUgYQwR9Sc4wdn366S9p5KPwgWn yDQnoI73Uodb9hez X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 21760 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 10/28/2015 11:00 AM, Pádraig Brady wrote: > Reopened until someone else votes. I'm 50:50 regarding the usefulness of --verbose. Writing "killed PRG after N seconds elapsed" sounds like a useful message, yet I'm afraid that then other requests may follow soon which may really bloat the code, e.g. $ timeout --verbose 10 sleep 5 timeout: child process terminated after 5.012 seconds. As it's easy to have a wrapper for the original request, I'd rather not add it. BTW: timeout shares stdout/stderr with its child; therefore, wouldn't the interleaved output be problematic? Have a nice day, Berny From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 28 10:51:13 2015 Received: (at 21760) by debbugs.gnu.org; 28 Oct 2015 14:51:13 +0000 Received: from localhost ([127.0.0.1]:42650 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZrS4G-0003zW-Tj for submit@debbugs.gnu.org; Wed, 28 Oct 2015 10:51:13 -0400 Received: from mail-vk0-f53.google.com ([209.85.213.53]:36371) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZrS4E-0003zM-Qo for 21760@debbugs.gnu.org; Wed, 28 Oct 2015 10:51:11 -0400 Received: by vkex70 with SMTP id x70so6347165vke.3 for <21760@debbugs.gnu.org>; Wed, 28 Oct 2015 07:51:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type:content-transfer-encoding; bh=jB/fy3Oxa66KGlZYjqs5w4CBhSIkjxr9sdSaXxw7Ivw=; b=pehItdfbTpy7mM3ca/0cQ0ArBQg9Nsb7o35X4XFKG1KvDW+kwwnR7QyilONucgTMV5 LUr1yhFvE0rgCMWQgAYIRqWSepYGrU3OWjjSQuhRvsfHha0WzU4TpUjwbjbo877JRpZj XS9nl4Z5HMDcVte4IOqipBnjzes4rxScsviU15AfP+XkD9tw5i6u6lPF3JIh0OlStz06 iyvq0ts43qLQgRHVrBapKfFbPguIBl0Bxa+ZqURngzG4qDHpBMWBonlsZdAETUN87EWY Q2lkSSQb9Z70PwKqSstVKu20NsZicQ7552BQ29IcBWs4UEM45HqxLtR9biEHh4zxJhcO 1Q7g== X-Received: by 10.31.178.198 with SMTP id b189mr30503314vkf.114.1446043870157; Wed, 28 Oct 2015 07:51:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.31.65.11 with HTTP; Wed, 28 Oct 2015 07:50:50 -0700 (PDT) In-Reply-To: <5630D759.6050207@bernhard-voelker.de> References: <562E00CC.7060307@thomas-guettler.de> <562E120A.3060601@draigBrady.com> <562E3805.2030704@thomas-guettler.de> <562E4C1D.6010402@draigBrady.com> <562E728D.4080301@thomas-guettler.de> <562E83E2.1030102@draigBrady.com> <5630763D.4000009@thomas-guettler.de> <56309CB6.7050802@draigBrady.com> <5630D759.6050207@bernhard-voelker.de> From: Jim Meyering Date: Wed, 28 Oct 2015 07:50:50 -0700 X-Google-Sender-Auth: G2BVq60MYCCyHP1RTRJkTCpEggo Message-ID: Subject: Re: bug#21760: timeout: Feature Request: --verbose ==> output if timeout was reached To: Bernhard Voelker Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 21760 Cc: 21760@debbugs.gnu.org, =?UTF-8?Q?P=C3=A1draig_Brady?= , =?UTF-8?Q?Thomas_G=C3=BCttler?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Wed, Oct 28, 2015 at 7:10 AM, Bernhard Voelker wrote: > On 10/28/2015 11:00 AM, P=C3=A1draig Brady wrote: >> >> Reopened until someone else votes. > > I'm 50:50 regarding the usefulness of --verbose. > Writing "killed PRG after N seconds elapsed" sounds like a useful > message, yet I'm afraid that then other requests may follow soon > which may really bloat the code, e.g. > > $ timeout --verbose 10 sleep 5 > timeout: child process terminated after 5.012 seconds. > > As it's easy to have a wrapper for the original request, I'd rather > not add it. This is the usual criterion/conclusion: if it is easy to implement the desi= red behavior via some other mechanism, we prefer not to add the option. If we had not adhered to this policy over the decades, coreutils programs would be far larger and harder to maintain, now. Please look at these many rejected requests to get a feel for how tricky it can be: http://www.gnu.org/software/coreutils/rejected_requests.html From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 28 16:18:04 2015 Received: (at 21760) by debbugs.gnu.org; 28 Oct 2015 20:18:04 +0000 Received: from localhost ([127.0.0.1]:42898 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZrXAZ-00054J-Q6 for submit@debbugs.gnu.org; Wed, 28 Oct 2015 16:18:04 -0400 Received: from joseki.proulx.com ([216.17.153.58]:39908) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZrXAX-00053w-TD for 21760@debbugs.gnu.org; Wed, 28 Oct 2015 16:18:02 -0400 Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id 8D09F21873; Wed, 28 Oct 2015 14:18:00 -0600 (MDT) Received: by hysteria.proulx.com (Postfix, from userid 1000) id 3209E2DC54; Wed, 28 Oct 2015 14:17:59 -0600 (MDT) Date: Wed, 28 Oct 2015 14:17:59 -0600 From: Bob Proulx To: Thomas =?iso-8859-1?Q?G=FCttler?= , 21760@debbugs.gnu.org Subject: Re: bug#21760: timeout: Feature Request: --verbose ==> output if timeout was reached Message-ID: <20151028135453818788781@bob.proulx.com> References: <562E00CC.7060307@thomas-guettler.de> <562E120A.3060601@draigBrady.com> <562E3805.2030704@thomas-guettler.de> <562E4C1D.6010402@draigBrady.com> <562E728D.4080301@thomas-guettler.de> <562E83E2.1030102@draigBrady.com> <5630763D.4000009@thomas-guettler.de> <56309CB6.7050802@draigBrady.com> <5630D759.6050207@bernhard-voelker.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5630D759.6050207@bernhard-voelker.de> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 21760 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Bernhard Voelker wrote: > Pádraig Brady wrote: > >Reopened until someone else votes. > > I'm 50:50 regarding the usefulness of --verbose. > Writing "killed PRG after N seconds elapsed" sounds like a useful > message, yet I'm afraid that then other requests may follow soon > which may really bloat the code, e.g. > > $ timeout --verbose 10 sleep 5 > timeout: child process terminated after 5.012 seconds. I am also 50:50 regarding the verbose message output. For example I don't like the N seconds, or N.012 more detailed output. As soon as this is produced there will be other people trying to parse it. Having that variable data in the middle of the string to parse makes it more complicated. Does it matter? Better would be just to say as concise as possible "timeout: terminated child process" and stop there. Having more verbosity usually sounds good. But it often isn't. In my experience it tends to make the code much more crufty than it would be otherwise. Harder to read the actual code for needing to read around the verbose output statements. And then because internal code changes will often change the verbose output it tends to break people who have come to rely upon those messages. Meaning it either freezes the implementation just as it is because changes would change the visible output or it risks breaking consumers of it if it changes. It is not a small problem. >>Thomas Güttler wrote: >>> A new team mate wasted some time to debug why >>> a process was killed with signal 15. >>>... >>> This is important in environments where the one who reads >>> the script failures is not the same person who writes the script. IMNHO this is a common bad type of thinking. The root cause of the problem was created by a bug in a locally written script. We haven't seen that script but most likely it will have additional problems. This bites someone. Having been bitten this becomes personal. Regardless of how unique or general having become personal it now becomes important to make sure that no one else ever suffers this problem again. Ever. Even if it creates additional problems. One of the hardest things is to balance the creation of additional problems with eliminating a previous problem. The simpler of the two is usually the best choice. > As it's easy to have a wrapper for the original request, I'd rather > not add it. I will reiterate that I don't feel strongly either way. As long as the output message is as simple as possible. > BTW: timeout shares stdout/stderr with its child; therefore, > wouldn't the interleaved output be problematic? A good example of a possible problem due to the law of unintended consequences. And if this leads to the request for --output-fd=N to reroute file descriptors just to work around it then that is much too much and shouldn't be done. Bob From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 28 20:15:26 2015 Received: (at 21760) by debbugs.gnu.org; 29 Oct 2015 00:15:26 +0000 Received: from localhost ([127.0.0.1]:43006 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZrasI-0002DJ-2V for submit@debbugs.gnu.org; Wed, 28 Oct 2015 20:15:26 -0400 Received: from mail2.vodafone.ie ([213.233.128.44]:5694) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZrasG-0002D9-CU for 21760@debbugs.gnu.org; Wed, 28 Oct 2015 20:15:24 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjcbAKRjMVZtTFO8/2dsb2JhbABeKII8UoMLiH22RIYbAoEtTAEBAQEBAYELQRMBg2EBAQQjVhALDQ0CBRYLAgIJAwIBAgFFEwgBAYgwAbN/hW+MAwEBAQcCIYEihFqFeYUQBxeCUoFFBZY9llSGGoxqY4JEgUA+gj2DdAEBAQ Received: from unknown (HELO localhost.localdomain) ([109.76.83.188]) by mail2.vodafone.ie with ESMTP; 29 Oct 2015 00:15:20 +0000 Subject: Re: bug#21760: timeout: Feature Request: --verbose ==> output if timeout was reached References: <562E00CC.7060307@thomas-guettler.de> <562E120A.3060601@draigBrady.com> <562E3805.2030704@thomas-guettler.de> <562E4C1D.6010402@draigBrady.com> <562E728D.4080301@thomas-guettler.de> <562E83E2.1030102@draigBrady.com> <5630763D.4000009@thomas-guettler.de> <56309CB6.7050802@draigBrady.com> <5630D759.6050207@bernhard-voelker.de> To: 21760@debbugs.gnu.org From: =?UTF-8?Q?P=c3=a1draig_Brady?= Message-ID: <56316518.5040400@draigBrady.com> Date: Thu, 29 Oct 2015 00:15:20 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 21760 Cc: =?UTF-8?Q?Thomas_G=c3=bcttler?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) tag 21760 wontfix close 21760 stop Thanks for the additional input Jim, Bernhard and Bob. From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 02 10:04:52 2017 Received: (at 21760) by debbugs.gnu.org; 2 Oct 2017 14:04:52 +0000 Received: from localhost ([127.0.0.1]:44286 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dz1L1-0006gY-OS for submit@debbugs.gnu.org; Mon, 02 Oct 2017 10:04:52 -0400 Received: from chiark.greenend.org.uk ([212.13.197.229]:40121 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dz1Kz-0006gQ-W1 for 21760@debbugs.gnu.org; Mon, 02 Oct 2017 10:04:50 -0400 Received: by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with local (return-path ijackson@chiark.greenend.org.uk) id 1dz1Ky-0001qg-Rx for 21760@debbugs.gnu.org; Mon, 02 Oct 2017 15:04:48 +0100 From: Ian Jackson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <22994.18304.789921.177698@chiark.greenend.org.uk> Date: Mon, 2 Oct 2017 15:04:48 +0100 To: 21760@debbugs.gnu.org Subject: timeout: Feature Request: --verbose ==> output if timeout X-Mailer: VM 8.2.0b under 24.4.1 (i586-pc-linux-gnu) X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 21760 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) I have to say that I find this bug thread quite perplexing. It is completely normal for a GNU/Unix command line utility to print a message to stderr in error cases. Almost every program that exits nonzero prints a message to stderr. The normal convention in shell scripts (and other contexts where commands are invoked) is to: * use the exit status to decide whether to continue executing * rely on the failing command to print a message to the script's stderr The stderr error message from a failing command appears on the user's terminal in a script run interactively; it appears in emailed logs from cron; it can appear in logfiles; etc. When I first discovered that GNU timeout(1) does not print an error message when the timeout occurs, I was astonished. IMO that ought to have been the default behaviour. Unfortunately that is too late to fix now but we should at least have a one-letter option to request behaviour compatible with normal shell programming conventions. The alternative is that at most times when use of timeout is added to some program or config file, the programmer/administrator will have to write a clumsy shell circumlocution to arrange that an appropriate message is sent to stderr. These runic shell circumlocutions will proliferate. They will have bugs. The bugs will propagate by cut-and-paste, followed by fixes for the bugs. Everyone's commands will become verbose and hard to understand. All of this could be prevented by simply providing a way to make timeout print a message to stderr. I guess I need to dispose of some the potential problems which have been advanced as counterarguments, even though to my mind they are extremely weak. A key observation I would make is that the arguments against timeout(1) printing a message are fully general counterarguments against _any_ program printing _any_ error message. Surely that shows that they can't be right. > For example I don't like the N seconds, or N.012 more detailed > output. As soon as this is produced there will be other people > trying to parse it. Most of the people who are asking for this feature don't care exactly what the message is. It should mention the program which was invoked and the fact that there was a timeout. The exact format is immaterial. The purpose is not for it to be parsed, but for it to be read by humans who are trying to debug something. This is generally true of error messages. If anyone complains that they are trying to parse this error message you can tell them not to be so silly. There will be many fewer of those than there will be people inconvenienced by the lack of a message at all. Likewise, if someone sends a patch to add more information to the message, that is not a problem. You can just accept it, or not, as you like. > BTW: timeout shares stdout/stderr with its child; therefore, > wouldn't the interleaved output be problematic? No. The purpose is precisely to have the error report from timeout(1) to go to the same place as errors from the command are reported. This is not a problem with any other adverbial command, of which there are very many nowadays. See for example xargs, fakeroot, faketime, authbind, etc. etc. > A good example of a possible problem due to the law of unintended > consequences. How bogglesome. This "interleaving" is precisely the intended consequence. (Actually, what will normally happen is that the message from timeout will follow all of the program's output.) > And if this leads to the request for --output-fd=N to > reroute file descriptors just to work around it then that is much too > much and shouldn't be done. Other adverbial commands have not had such requests and in general I agree that they should be rejected. If this is a problem then a shell rune can be used to replumb the fds. That is a hypothetical timeout -v --output-fd=42 blah blah can be replaced with timeout 3>&2 2>&42 -v sh -ec 'exec 2>&3 3>&- "$@"' x blah blah (assuming fd 3 is not used for something else in $@). This is a fully general technique which can be deployed to implement any such minority use case. The main point is that "want it to print an error message if there is an error" is not a minority use case. Ian. -- Ian Jackson These opinions are my own. If I emailed you from an address @fyvzl.net or @evade.org.uk, that is a private address which bypasses my fierce spamfilter. From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 04 02:37:03 2017 Received: (at 21760) by debbugs.gnu.org; 4 Oct 2017 06:37:03 +0000 Received: from localhost ([127.0.0.1]:47305 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dzdIl-0000VX-9b for submit@debbugs.gnu.org; Wed, 04 Oct 2017 02:37:03 -0400 Received: from mail.magicbluesmoke.com ([82.195.144.49]:48312) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dzdIj-0000V8-52 for 21760@debbugs.gnu.org; Wed, 04 Oct 2017 02:37:01 -0400 Received: from localhost.localdomain (c-73-158-116-184.hsd1.ca.comcast.net [73.158.116.184]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.magicbluesmoke.com (Postfix) with ESMTPSA id 180B994E1; Wed, 4 Oct 2017 07:36:59 +0100 (IST) Subject: Re: bug#21760: timeout: Feature Request: --verbose ==> output if timeout To: Ian Jackson , 21760@debbugs.gnu.org References: <562E00CC.7060307@thomas-guettler.de> <22994.18304.789921.177698@chiark.greenend.org.uk> From: =?UTF-8?Q?P=c3=a1draig_Brady?= Message-ID: <1898e77e-28b1-b395-d5ad-b5534ee8c230@draigBrady.com> Date: Tue, 3 Oct 2017 23:36:57 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <22994.18304.789921.177698@chiark.greenend.org.uk> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 21760 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On 02/10/17 07:04, Ian Jackson wrote: > I have to say that I find this bug thread quite perplexing. > > It is completely normal for a GNU/Unix command line utility to print a > message to stderr in error cases. Almost every program that exits > nonzero prints a message to stderr. > > The normal convention in shell scripts (and other contexts where > commands are invoked) is to: > * use the exit status to decide whether to continue executing > * rely on the failing command to print a message to the script's > stderr > > The stderr error message from a failing command appears on the user's > terminal in a script run interactively; it appears in emailed logs > from cron; it can appear in logfiles; etc. > > When I first discovered that GNU timeout(1) does not print an error > message when the timeout occurs, I was astonished. IMO that ought to > have been the default behaviour. Unfortunately that is too late to > fix now but we should at least have a one-letter option to request > behaviour compatible with normal shell programming conventions. > > > The alternative is that at most times when use of timeout is added to > some program or config file, the programmer/administrator will have to > write a clumsy shell circumlocution to arrange that an appropriate > message is sent to stderr. > > These runic shell circumlocutions will proliferate. They will have > bugs. The bugs will propagate by cut-and-paste, followed by fixes for > the bugs. Everyone's commands will become verbose and hard to > understand. > > All of this could be prevented by simply providing a way to make > timeout print a message to stderr. > > > I guess I need to dispose of some the potential problems which have > been advanced as counterarguments, even though to my mind they are > extremely weak. > > A key observation I would make is that the arguments against > timeout(1) printing a message are fully general counterarguments > against _any_ program printing _any_ error message. Surely that shows > that they can't be right. > >> For example I don't like the N seconds, or N.012 more detailed >> output. As soon as this is produced there will be other people >> trying to parse it. > > Most of the people who are asking for this feature don't care exactly > what the message is. It should mention the program which was invoked > and the fact that there was a timeout. The exact format is > immaterial. > > The purpose is not for it to be parsed, but for it to be read by > humans who are trying to debug something. This is generally true of > error messages. > > If anyone complains that they are trying to parse this error message > you can tell them not to be so silly. There will be many fewer of > those than there will be people inconvenienced by the lack of a > message at all. > > Likewise, if someone sends a patch to add more information to the > message, that is not a problem. You can just accept it, or not, as > you like. > >> BTW: timeout shares stdout/stderr with its child; therefore, >> wouldn't the interleaved output be problematic? > > No. The purpose is precisely to have the error report from timeout(1) > to go to the same place as errors from the command are reported. > > This is not a problem with any other adverbial command, of which there > are very many nowadays. See for example xargs, fakeroot, faketime, > authbind, etc. etc. > >> A good example of a possible problem due to the law of unintended >> consequences. > > How bogglesome. This "interleaving" is precisely the intended > consequence. (Actually, what will normally happen is that the message > from timeout will follow all of the program's output.) > >> And if this leads to the request for --output-fd=N to >> reroute file descriptors just to work around it then that is much too >> much and shouldn't be done. > > Other adverbial commands have not had such requests and in general I > agree that they should be rejected. If this is a problem then a shell > rune can be used to replumb the fds. > > That is a hypothetical timeout -v --output-fd=42 blah blah > can be replaced with > timeout 3>&2 2>&42 -v sh -ec 'exec 2>&3 3>&- "$@"' x blah blah > (assuming fd 3 is not used for something else in $@). This is > a fully general technique which can be deployed to implement any > such minority use case. > > > The main point is that "want it to print an error message if there is > an error" is not a minority use case. Thanks for detailing your arguments, and +2 for the phrase: "runic shell circumlocutions will proliferate" :) A reason we don't output a message by default is that timeout(1) could be used to run a process which runs for an indeterminate amount of time like: timeout --preserve-status 1d ./simulation Whether we support `timeout --verbose` is one of those marginal cases. Using shell works with all versions of timeout, but it's not trivial due to differing exit status. For example if a SIGKILL was sent most shells return 137, while ksh returns 265. I agree with you that the stderr interleaving is probably not a practical issue. So I'm leaning towards supporting --verbose which would output something like: timeout: aborting command 'blah' with signal SIGTERM timeout: aborting command 'blah' with signal SIGKILL cheers, Pádraig From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 04 06:20:06 2017 Received: (at 21760) by debbugs.gnu.org; 4 Oct 2017 10:20:06 +0000 Received: from localhost ([127.0.0.1]:47574 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dzgmb-0008H1-Qb for submit@debbugs.gnu.org; Wed, 04 Oct 2017 06:20:05 -0400 Received: from chiark.greenend.org.uk ([212.13.197.229]:48500 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dzgma-0008Gr-DF for 21760@debbugs.gnu.org; Wed, 04 Oct 2017 06:20:04 -0400 Received: by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with local (return-path ijackson@chiark.greenend.org.uk) id 1dzgmZ-0004be-AU; Wed, 04 Oct 2017 11:20:03 +0100 From: Ian Jackson MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Message-ID: <22996.46547.228142.439552@chiark.greenend.org.uk> Date: Wed, 4 Oct 2017 11:20:03 +0100 To: =?iso-8859-1?Q?P=E1draig?= Brady Subject: Re: bug#21760: timeout: Feature Request: --verbose ==> output if timeout In-Reply-To: <1898e77e-28b1-b395-d5ad-b5534ee8c230@draigBrady.com> References: <562E00CC.7060307@thomas-guettler.de> <22994.18304.789921.177698@chiark.greenend.org.uk> <1898e77e-28b1-b395-d5ad-b5534ee8c230@draigBrady.com> X-Mailer: VM 8.2.0b under 24.4.1 (i586-pc-linux-gnu) X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 21760 Cc: 21760@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) P=E1draig Brady writes ("Re: bug#21760: timeout: Feature Request: --ver= bose =3D=3D> output if timeout"): > Thanks for detailing your arguments, and +2 for the phrase: > "runic shell circumlocutions will proliferate" :) YW :-). > So I'm leaning towards supporting --verbose which would output someth= ing like: >=20 > timeout: aborting command 'blah' with signal SIGTERM > timeout: aborting command 'blah' with signal SIGKILL Yes, please, that would do nicely. Regards, Ian. From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 04 06:20:49 2017 Received: (at 21760) by debbugs.gnu.org; 4 Oct 2017 10:20:49 +0000 Received: from localhost ([127.0.0.1]:47577 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dzgnJ-0008I0-1b for submit@debbugs.gnu.org; Wed, 04 Oct 2017 06:20:49 -0400 Received: from chiark.greenend.org.uk ([212.13.197.229]:48554 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dzgnH-0008Hq-Qq for 21760@debbugs.gnu.org; Wed, 04 Oct 2017 06:20:48 -0400 Received: by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with local (return-path ijackson@chiark.greenend.org.uk) id 1dzgnH-0004ss-7P; Wed, 04 Oct 2017 11:20:47 +0100 From: Ian Jackson MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Message-ID: <22996.46591.165028.268407@chiark.greenend.org.uk> Date: Wed, 4 Oct 2017 11:20:47 +0100 To: =?iso-8859-1?Q?P=E1draig?= Brady , 21760@debbugs.gnu.org Subject: Re: bug#21760: timeout: Feature Request: --verbose ==> output if timeout In-Reply-To: <22996.46547.228142.439552@chiark.greenend.org.uk> References: <562E00CC.7060307@thomas-guettler.de> <22994.18304.789921.177698@chiark.greenend.org.uk> <1898e77e-28b1-b395-d5ad-b5534ee8c230@draigBrady.com> <22996.46547.228142.439552@chiark.greenend.org.uk> X-Mailer: VM 8.2.0b under 24.4.1 (i586-pc-linux-gnu) X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 21760 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Ian Jackson writes ("Re: bug#21760: timeout: Feature Request: --verbose= =3D=3D> output if timeout"): > P=E1draig Brady writes ("Re: bug#21760: timeout: Feature Request: --v= erbose =3D=3D> output if timeout"): > > timeout: aborting command 'blah' with signal SIGTERM > > timeout: aborting command 'blah' with signal SIGKILL >=20 > Yes, please, that would do nicely. I guess we can have -v for this, as well as --verbose ? Ian. From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 23 17:35:51 2017 Received: (at 21760-done) by debbugs.gnu.org; 23 Nov 2017 22:35:51 +0000 Received: from localhost ([127.0.0.1]:54295 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eI062-0006is-Lq for submit@debbugs.gnu.org; Thu, 23 Nov 2017 17:35:51 -0500 Received: from mail.magicbluesmoke.com ([82.195.144.49]:42988) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eI060-0006ii-6P for 21760-done@debbugs.gnu.org; Thu, 23 Nov 2017 17:35:48 -0500 Received: from localhost.localdomain (c-73-158-116-184.hsd1.ca.comcast.net [73.158.116.184]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.magicbluesmoke.com (Postfix) with ESMTPSA id 5AFD275; Thu, 23 Nov 2017 22:35:46 +0000 (GMT) Subject: Re: bug#21760: timeout: Feature Request: --verbose ==> output if timeout To: Ian Jackson , 21760-done@debbugs.gnu.org References: <562E00CC.7060307@thomas-guettler.de> <22994.18304.789921.177698@chiark.greenend.org.uk> <1898e77e-28b1-b395-d5ad-b5534ee8c230@draigBrady.com> From: =?UTF-8?Q?P=c3=a1draig_Brady?= Message-ID: <5bbcf26c-71e9-d27f-f6b6-44785743e607@draigBrady.com> Date: Thu, 23 Nov 2017 14:35:44 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <1898e77e-28b1-b395-d5ad-b5534ee8c230@draigBrady.com> Content-Type: multipart/mixed; boundary="------------B8BE11079E337D6C4574DA4C" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 21760-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) This is a multi-part message in MIME format. --------------B8BE11079E337D6C4574DA4C Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit On 03/10/17 23:36, Pádraig Brady wrote: > On 02/10/17 07:04, Ian Jackson wrote: >> I have to say that I find this bug thread quite perplexing. >> >> It is completely normal for a GNU/Unix command line utility to print a >> message to stderr in error cases. Almost every program that exits >> nonzero prints a message to stderr. >> >> The normal convention in shell scripts (and other contexts where >> commands are invoked) is to: >> * use the exit status to decide whether to continue executing >> * rely on the failing command to print a message to the script's >> stderr >> >> The stderr error message from a failing command appears on the user's >> terminal in a script run interactively; it appears in emailed logs >> from cron; it can appear in logfiles; etc. >> >> When I first discovered that GNU timeout(1) does not print an error >> message when the timeout occurs, I was astonished. IMO that ought to >> have been the default behaviour. Unfortunately that is too late to >> fix now but we should at least have a one-letter option to request >> behaviour compatible with normal shell programming conventions. >> >> >> The alternative is that at most times when use of timeout is added to >> some program or config file, the programmer/administrator will have to >> write a clumsy shell circumlocution to arrange that an appropriate >> message is sent to stderr. >> >> These runic shell circumlocutions will proliferate. They will have >> bugs. The bugs will propagate by cut-and-paste, followed by fixes for >> the bugs. Everyone's commands will become verbose and hard to >> understand. >> >> All of this could be prevented by simply providing a way to make >> timeout print a message to stderr. >> >> >> I guess I need to dispose of some the potential problems which have >> been advanced as counterarguments, even though to my mind they are >> extremely weak. >> >> A key observation I would make is that the arguments against >> timeout(1) printing a message are fully general counterarguments >> against _any_ program printing _any_ error message. Surely that shows >> that they can't be right. >> >>> For example I don't like the N seconds, or N.012 more detailed >>> output. As soon as this is produced there will be other people >>> trying to parse it. >> >> Most of the people who are asking for this feature don't care exactly >> what the message is. It should mention the program which was invoked >> and the fact that there was a timeout. The exact format is >> immaterial. >> >> The purpose is not for it to be parsed, but for it to be read by >> humans who are trying to debug something. This is generally true of >> error messages. >> >> If anyone complains that they are trying to parse this error message >> you can tell them not to be so silly. There will be many fewer of >> those than there will be people inconvenienced by the lack of a >> message at all. >> >> Likewise, if someone sends a patch to add more information to the >> message, that is not a problem. You can just accept it, or not, as >> you like. >> >>> BTW: timeout shares stdout/stderr with its child; therefore, >>> wouldn't the interleaved output be problematic? >> >> No. The purpose is precisely to have the error report from timeout(1) >> to go to the same place as errors from the command are reported. >> >> This is not a problem with any other adverbial command, of which there >> are very many nowadays. See for example xargs, fakeroot, faketime, >> authbind, etc. etc. >> >>> A good example of a possible problem due to the law of unintended >>> consequences. >> >> How bogglesome. This "interleaving" is precisely the intended >> consequence. (Actually, what will normally happen is that the message >> from timeout will follow all of the program's output.) >> >>> And if this leads to the request for --output-fd=N to >>> reroute file descriptors just to work around it then that is much too >>> much and shouldn't be done. >> >> Other adverbial commands have not had such requests and in general I >> agree that they should be rejected. If this is a problem then a shell >> rune can be used to replumb the fds. >> >> That is a hypothetical timeout -v --output-fd=42 blah blah >> can be replaced with >> timeout 3>&2 2>&42 -v sh -ec 'exec 2>&3 3>&- "$@"' x blah blah >> (assuming fd 3 is not used for something else in $@). This is >> a fully general technique which can be deployed to implement any >> such minority use case. >> >> >> The main point is that "want it to print an error message if there is >> an error" is not a minority use case. > > Thanks for detailing your arguments, and +2 for the phrase: > "runic shell circumlocutions will proliferate" :) > > A reason we don't output a message by default is that > timeout(1) could be used to run a process which runs > for an indeterminate amount of time like: > > timeout --preserve-status 1d ./simulation > > Whether we support `timeout --verbose` is one of those marginal cases. > Using shell works with all versions of timeout, but it's not > trivial due to differing exit status. For example if a SIGKILL was sent > most shells return 137, while ksh returns 265. > > I agree with you that the stderr interleaving is probably not a practical issue. > > So I'm leaning towards supporting --verbose which would output something like: > > timeout: aborting command 'blah' with signal SIGTERM > timeout: aborting command 'blah' with signal SIGKILL Handled in the attached. Marking this as done. cheers, Pádraig --------------B8BE11079E337D6C4574DA4C Content-Type: text/x-patch; name="timeout--verbose.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="timeout--verbose.patch" >From 9240a4d7d3c4ef9e31325de96ece5904f0884ee2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Thu, 23 Nov 2017 14:30:59 -0800 Subject: [PATCH] timeout: add --verbose to diagnose timeouts This is useful as handling in shell is complicated with the varying exit status in the --kill-after case. * src/timeout.c (main): Handle '-v' and store COMMAND for the diagnostic. (cleanup): Diagnose the signal name before sending. (usage): Document -v, --verbose. * doc/coreutils.texi (timeout invocation): Likewise. * tests/misc/timeout.sh: Add a test case. * NEWS: Mention the new feature Fixes https://bugs.gnu.org/21760 --- NEWS | 4 ++++ doc/coreutils.texi | 6 ++++++ src/timeout.c | 20 +++++++++++++++++++- tests/misc/timeout.sh | 8 ++++++++ 4 files changed, 37 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index bc5d5be..2f387d8 100644 --- a/NEWS +++ b/NEWS @@ -31,6 +31,10 @@ GNU coreutils NEWS -*- outline -*- timeout would have then waited for the time limit to expire. [bug introduced in coreutils-8.27] +** New features + + timeout now supports the --verbose option to diagnose force termination. + ** Improvements tail --bytes=NUM will efficiently seek to the end of block devices, diff --git a/doc/coreutils.texi b/doc/coreutils.texi index d374b4a..57ec227 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -17388,6 +17388,12 @@ the @var{command}. Send this @var{signal} to @var{command} on timeout, rather than the default @samp{TERM} signal. @var{signal} may be a name like @samp{HUP} or a number. @xref{Signal specifications}. + +@item -v +@itemx --verbose +@opindex -v +@opindex --verbose +Diagnose to stderr, the signal sent upon timeout. @end table @cindex time units diff --git a/src/timeout.c b/src/timeout.c index 5627819..8ba58dd 100644 --- a/src/timeout.c +++ b/src/timeout.c @@ -83,6 +83,8 @@ static pid_t monitored_pid; static double kill_after; static bool foreground; /* whether to use another program group. */ static bool preserve_status; /* whether to use a timeout status or not. */ +static bool verbose; /* whether to diagnose timeouts or not. */ +static char const* command; /* for long options with no corresponding short option, use enum */ enum @@ -95,6 +97,7 @@ static struct option const long_options[] = { {"kill-after", required_argument, NULL, 'k'}, {"signal", required_argument, NULL, 's'}, + {"verbose", no_argument, NULL, 'v'}, {"foreground", no_argument, NULL, FOREGROUND_OPTION}, {"preserve-status", no_argument, NULL, PRESERVE_STATUS_OPTION}, {GETOPT_HELP_OPTION_DECL}, @@ -196,6 +199,14 @@ cleanup (int sig) /* Send the signal directly to the monitored child, in case it has itself become group leader, or is not running in a separate group. */ + if (verbose) + { + char signame[MAX (SIG2STR_MAX, INT_BUFSIZE_BOUND (int))]; + if (sig2str (sig, signame) != 0) + snprintf (signame, sizeof signame, "%d", sig); + error (0, 0, _("aborting command %s with signal %s"), + quote (command), signame); + } send_sig (monitored_pid, sig); /* The normal case is the job has remained in our @@ -246,6 +257,8 @@ Start COMMAND, and kill it if still running after DURATION.\n\ specify the signal to be sent on timeout;\n\ SIGNAL may be a name like 'HUP' or a number;\n\ see 'kill -l' for a list of signals\n"), stdout); + fputs (_("\ + -v, --verbose diagnose to stderr the signal sent upon timeout\n"), stdout); fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); @@ -443,6 +456,10 @@ main (int argc, char **argv) usage (EXIT_CANCELED); break; + case 'v': + verbose = true; + break; + case FOREGROUND_OPTION: foreground = true; break; @@ -467,6 +484,7 @@ main (int argc, char **argv) timeout = parse_duration (argv[optind++]); argv += optind; + command = argv[0]; /* Ensure we're in our own group so all subprocesses can be killed. Note we don't just put the child in a separate group as @@ -498,7 +516,7 @@ main (int argc, char **argv) /* exit like sh, env, nohup, ... */ int exit_status = errno == ENOENT ? EXIT_ENOENT : EXIT_CANNOT_INVOKE; - error (0, errno, _("failed to run command %s"), quote (argv[0])); + error (0, errno, _("failed to run command %s"), quote (command)); return exit_status; } else diff --git a/tests/misc/timeout.sh b/tests/misc/timeout.sh index 1c76589..f75e2be 100755 --- a/tests/misc/timeout.sh +++ b/tests/misc/timeout.sh @@ -57,4 +57,12 @@ out=$(sleep .1 & exec timeout .5 sh -c 'sleep 2; echo foo') status=$? test "$out" = "" && test $status = 124 || fail=1 +# Verify --verbose output +timeout --verbose -s0 -k .1 .1 sleep 10 2> err +cat > exp <<\EOF +timeout: aborting command 'sleep' with signal EXIT +timeout: aborting command 'sleep' with signal KILL +EOF +compare exp err || fail=1 + Exit $fail -- 2.9.3 --------------B8BE11079E337D6C4574DA4C-- From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 23 18:38:46 2017 Received: (at 21760) by debbugs.gnu.org; 23 Nov 2017 23:38:46 +0000 Received: from localhost ([127.0.0.1]:54365 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eI14w-00089h-FZ for submit@debbugs.gnu.org; Thu, 23 Nov 2017 18:38:46 -0500 Received: from mail-qt0-f181.google.com ([209.85.216.181]:39863) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eI14v-00089R-5n; Thu, 23 Nov 2017 18:38:45 -0500 Received: by mail-qt0-f181.google.com with SMTP id p44so29563125qtj.6; Thu, 23 Nov 2017 15:38:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=SBDgxyvGF9MUkrDrSi06UxNI08WgHqhHail3zFD1qgA=; b=pFjNw4YIVyzxO4NCxWI5hafX1uXlt/08WmQ5HDoiIBF5U6GKHco44BUZu+xD9kdvi0 /yGuZUVYuBu8IH8KkV/3dujUR/st7euH1CHvqbaxvldLcSrEFFY8NMM8h5pUESrS0kRw RYMi8YXiLSv58MHTTSjfiBkQJdEdzUh782SJXyjM0N3azAAYKNO89yKJxV5zshmQNKnX MFkb97V+GllPc8BE8oQ2MtdbB/QzhiH2kME6GkkZ0Usrt/fKrLRrEntHrWisubu9L+VW kZ66T1PJ3p5aSt4JTTOsO7i0tWlT3a1l6V/yG7AWyNRHNOhqeUpdO8fu4Sx9wYFJcPHw fzDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=SBDgxyvGF9MUkrDrSi06UxNI08WgHqhHail3zFD1qgA=; b=XytEYFYFu81t8LTzDcablknO80V8opAqSSHr1mFtHH1IlP6M+YxAZm1w0C3bU/eA2j akrOLG0DEnuz84Efh50LSVmTgXaLH6nyNLQUQLsOHeJFmb/jfszRyYpqNQWnaKCBM3mr JCTJK0rVaL8TQ4BZ4NJeDlCT1KT6u3pCyDGwkI/mTbf5MExf66TKVhna4nbss/ueyZgN 8Cs/NbHvUSUI42fOK50Y48hh1SDtjT+5H7rj4eRcCSMaHIw9MoQ4eB6ocFMNjP0BDLd4 2h4R3PrHB9FGSs50Jx3jo0tQnvRRfBjLgdWCmhS8IOBSmAWWF0FrWOU0YlxWmaD3KAdW svag== X-Gm-Message-State: AJaThX54hJFMqk+KQgyUtjFw9Zl+lPyTj6OBACNpuZ19Tg1RG4d2Idjs awQCgVJ+pKWgSPm9ZF7QcUb/RFCpLT725VGH4yU2yg== X-Google-Smtp-Source: AGs4zMZZdhTX1kZOcp2Nz8Vand187lVPqPd2jInzNFyhkyaB8dWSG6Cd1PEMfm+UwP9FguutqmvpysW/znh1ZYTdzYU= X-Received: by 10.200.48.51 with SMTP id f48mr21404725qte.262.1511480318707; Thu, 23 Nov 2017 15:38:38 -0800 (PST) MIME-Version: 1.0 Received: by 10.55.9.17 with HTTP; Thu, 23 Nov 2017 15:38:17 -0800 (PST) In-Reply-To: <5bbcf26c-71e9-d27f-f6b6-44785743e607@draigBrady.com> References: <562E00CC.7060307@thomas-guettler.de> <22994.18304.789921.177698@chiark.greenend.org.uk> <1898e77e-28b1-b395-d5ad-b5534ee8c230@draigBrady.com> <5bbcf26c-71e9-d27f-f6b6-44785743e607@draigBrady.com> From: Jim Meyering Date: Thu, 23 Nov 2017 15:38:17 -0800 X-Google-Sender-Auth: 1-kcZ435VrQmwULWyF02inFN10k Message-ID: Subject: Re: bug#21760: timeout: Feature Request: --verbose ==> output if timeout To: 21760@debbugs.gnu.org, =?UTF-8?Q?P=C3=A1draig_Brady?= , =?UTF-8?Q?Thomas_G=C3=BCttler?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.6 (/) X-Debbugs-Envelope-To: 21760 Cc: 21760-done@debbugs.gnu.org, Ian Jackson X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) On Thu, Nov 23, 2017 at 2:35 PM, P=C3=A1draig Brady wrot= e: ... >> So I'm leaning towards supporting --verbose which would output something= like: >> >> timeout: aborting command 'blah' with signal SIGTERM >> timeout: aborting command 'blah' with signal SIGKILL + error (0, 0, _("aborting command %s with signal %s"), + quote (command), signame); I like it, though maybe print "sending signal %s to command %s" ? Sometimes (as above), the first attempt doesn't affect the process, much less send SIGABRT, which one might infer from the use of "abort". Also wording related, "the signal sent upon timeout" appears both in code and in doc. I'd s/the/any/, since there can be more than one. From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 23 20:48:24 2017 Received: (at 21760) by debbugs.gnu.org; 24 Nov 2017 01:48:24 +0000 Received: from localhost ([127.0.0.1]:54465 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eI36O-0006TS-Ee for submit@debbugs.gnu.org; Thu, 23 Nov 2017 20:48:24 -0500 Received: from mail.magicbluesmoke.com ([82.195.144.49]:32916) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eI36M-0006TE-E4; Thu, 23 Nov 2017 20:48:22 -0500 Received: from localhost.localdomain (c-73-158-116-184.hsd1.ca.comcast.net [73.158.116.184]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.magicbluesmoke.com (Postfix) with ESMTPSA id 7A1614A7A; Fri, 24 Nov 2017 01:48:20 +0000 (GMT) Subject: Re: bug#21760: timeout: Feature Request: --verbose ==> output if timeout To: Jim Meyering , 21760@debbugs.gnu.org, =?UTF-8?Q?Thomas_G=c3=bcttler?= References: <562E00CC.7060307@thomas-guettler.de> <22994.18304.789921.177698@chiark.greenend.org.uk> <1898e77e-28b1-b395-d5ad-b5534ee8c230@draigBrady.com> <5bbcf26c-71e9-d27f-f6b6-44785743e607@draigBrady.com> From: =?UTF-8?Q?P=c3=a1draig_Brady?= Message-ID: Date: Thu, 23 Nov 2017 17:48:18 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 21760 Cc: 21760-done@debbugs.gnu.org, Ian Jackson X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On 23/11/17 15:38, Jim Meyering wrote: > On Thu, Nov 23, 2017 at 2:35 PM, Pádraig Brady wrote: > ... >>> So I'm leaning towards supporting --verbose which would output something like: >>> >>> timeout: aborting command 'blah' with signal SIGTERM >>> timeout: aborting command 'blah' with signal SIGKILL > > + error (0, 0, _("aborting command %s with signal %s"), > + quote (command), signame); > > I like it, though maybe print "sending signal %s to command %s" ? > Sometimes (as above), the first attempt doesn't affect the process, > much less send SIGABRT, which one might infer from the use of "abort". > > Also wording related, "the signal sent upon timeout" appears both in > code and in doc. I'd s/the/any/, since there can be more than one. > Pushed with those improvements. thanks for the review, Pádraig From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 27 10:18:51 2017 Received: (at 21760) by debbugs.gnu.org; 27 Nov 2017 15:18:51 +0000 Received: from localhost ([127.0.0.1]:32853 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJLBL-0004cb-3k for submit@debbugs.gnu.org; Mon, 27 Nov 2017 10:18:51 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:50400) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJLBI-0004cL-FJ for 21760@debbugs.gnu.org; Mon, 27 Nov 2017 10:18:49 -0500 Received: from [10.0.2.15] ([62.153.148.194]) by mrelayeu.kundenserver.de (mreue104 [212.227.15.183]) with ESMTPSA (Nemesis) id 0M4HbP-1fBAeV3c5D-00rnpL; Mon, 27 Nov 2017 16:18:36 +0100 From: Bernhard Voelker Subject: Re: bug#21760: timeout: Feature Request: --verbose ==> output if timeout To: =?UTF-8?Q?P=c3=a1draig_Brady?= , Jim Meyering , 21760@debbugs.gnu.org, =?UTF-8?Q?Thomas_G=c3=bcttler?= References: <562E00CC.7060307@thomas-guettler.de> <22994.18304.789921.177698@chiark.greenend.org.uk> <1898e77e-28b1-b395-d5ad-b5534ee8c230@draigBrady.com> <5bbcf26c-71e9-d27f-f6b6-44785743e607@draigBrady.com> Message-ID: <4231e350-b22b-091e-5e95-481db0b23936@bernhard-voelker.de> Date: Mon, 27 Nov 2017 16:18:34 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------B5FE019BD32B80D0B5A0F9FF" Content-Language: de-DE-1901 X-Provags-ID: V03:K0:M1GvZWR/2YmXbVm8r0TUltWZPTrimdtT9lPG5tCk6/bqUHk6aVr IlEZ8qTzJiLOle9cdNANpTKrlpCNluGUaQNqnfXmwxC09XF3nkpxcFwmHc+zX20zgq8mR7l xDeBepkSJESLUc9O1wtzu7x7jx1G+vwgiHcFMq9L69cVmV8ZnTtQUD/wnQGYmiZ+gImUV5p 3YTCgU1QtH1XJnpTWJRuQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:cZ1kLTLxcag=:jiU/1YpnzC7hHrsGxe6mjP LrnjIe7cBlNx8AA0U9PfMYR2iWSV4MLS/WWBM6s2+AJZERANb6w/+/1DuIAhNzgsHVBOfH0z7 hUhFk6zgM+7m9BmFj9M4df1rS5/WYu+NVGT8IU67KSsyhhlT/rGRx9CcN0+oOexhLxdU1brVJ 8uV+LS/BRFRaPReOYk1ieY4hw9tgAO/czLaQOlMoxVuoIElFN7ApM/5ZssLz+FuXl/Giuajw5 wtxlKrTTztoN3N9FJkWO9p4n7xm+e0WTb1nlfGO2ZjNg/kMp3oknAItHMiARt+8vp+lQVX9kC js+qRlRN3kgUk5TEdvecEWhDbb1E9AsN9IKFQ+tg9lV7XVJ3x5HGAv6yKl5l2Loxqa5e41SZ0 9IFXEOcPg9Kj0ReHllIsDlXPNcUTVBtWyKvEhwM1JhKId0m1NmDgdRsr3yfv2HmdTo0l4xjsP aGCBNlOsKfDSlmeA+eHHv5RbDkgs5cVRzksJ7GJ+C3ptcXtHmdO8i2C0ba4ckH8BDCqMa3pDZ sGr26m+7Tj3fr41PhAcuFmBKBHgEjpqeEXWxWvjKPAPn2XybVAZGrGYx5+v2LZXtf/ibkgj9u mv2NbykLDLa9fhgSufewxoSeTo4XvBkp1ABfpp3bt0lKJGZyw11Sq97jqbNSd1do4eRdrzJf1 ETubUNk3KkJSSWeeJCdLpac6iXJ1YbHLa5UuvEH7OfLwZfqXxUh/DggVF2cz9FcwCVEqHJzeO ViCY1ySZELFajQvTt8bUvAH8N0z6vu9oZYgLgQ== X-Spam-Score: -0.1 (/) X-Debbugs-Envelope-To: 21760 Cc: Ian Jackson X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) This is a multi-part message in MIME format. --------------B5FE019BD32B80D0B5A0F9FF Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit [sending again, because the first try came back with some unclear error message, and the message didn't show up on the ML so far.] On 11/24/2017 02:48 AM, Pádraig Brady wrote: > Pushed with those improvements. Sorry, this comes a bit late. That change only added support for the long option, so the attached makes timeout also recognize the short -v option as advertized in usage+texi. BTW: what do you think about a new syntax-check rule to verify that all options in usage are actually supported? Some of the option checks for some utilities might become complicated, but maybe still worth ... Thanks & have a nice day, Berny --------------B5FE019BD32B80D0B5A0F9FF Content-Type: text/x-patch; name="0001-timeout-also-support-short-v-option.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-timeout-also-support-short-v-option.patch" >From b505cc39fcd0e461f5ee7b94231e162300e10412 Mon Sep 17 00:00:00 2001 From: Bernhard Voelker Date: Mon, 27 Nov 2017 11:25:39 +0100 Subject: [PATCH] timeout: also support short -v option * src/timeout.c (main): Add short option character 'v' to getopt_long call. * tests/misc/timeout.sh: Run the test both for the long and the short option. --- src/timeout.c | 2 +- tests/misc/timeout.sh | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/timeout.c b/src/timeout.c index 466ada2ef..c7b3161d6 100644 --- a/src/timeout.c +++ b/src/timeout.c @@ -442,7 +442,7 @@ main (int argc, char **argv) initialize_exit_failure (EXIT_CANCELED); atexit (close_stdout); - while ((c = getopt_long (argc, argv, "+k:s:", long_options, NULL)) != -1) + while ((c = getopt_long (argc, argv, "+k:s:v", long_options, NULL)) != -1) { switch (c) { diff --git a/tests/misc/timeout.sh b/tests/misc/timeout.sh index a4a55b615..77d5998db 100755 --- a/tests/misc/timeout.sh +++ b/tests/misc/timeout.sh @@ -58,11 +58,13 @@ status=$? test "$out" = "" && test $status = 124 || fail=1 # Verify --verbose output -timeout --verbose -s0 -k .1 .1 sleep 10 2> err cat > exp <<\EOF timeout: sending signal EXIT to command 'sleep' timeout: sending signal KILL to command 'sleep' EOF -compare exp err || fail=1 +for opt in -v --verbose; do + timeout $opt -s0 -k .1 .1 sleep 10 2> err + compare exp err || fail=1 +done Exit $fail -- 2.15.0 --------------B5FE019BD32B80D0B5A0F9FF-- From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 27 13:21:18 2017 Received: (at 21760) by debbugs.gnu.org; 27 Nov 2017 18:21:18 +0000 Received: from localhost ([127.0.0.1]:33007 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJO1u-0000u6-D3 for submit@debbugs.gnu.org; Mon, 27 Nov 2017 13:21:18 -0500 Received: from mail.magicbluesmoke.com ([82.195.144.49]:57366) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJO1s-0000tx-LL for 21760@debbugs.gnu.org; Mon, 27 Nov 2017 13:21:17 -0500 Received: from localhost.localdomain (c-73-158-116-184.hsd1.ca.comcast.net [73.158.116.184]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.magicbluesmoke.com (Postfix) with ESMTPSA id 4B7639BAE; Mon, 27 Nov 2017 18:21:14 +0000 (GMT) Subject: Re: bug#21760: timeout: Feature Request: --verbose ==> output if timeout To: Bernhard Voelker , Jim Meyering , 21760@debbugs.gnu.org, =?UTF-8?Q?Thomas_G=c3=bcttler?= References: <562E00CC.7060307@thomas-guettler.de> <22994.18304.789921.177698@chiark.greenend.org.uk> <1898e77e-28b1-b395-d5ad-b5534ee8c230@draigBrady.com> <5bbcf26c-71e9-d27f-f6b6-44785743e607@draigBrady.com> <4231e350-b22b-091e-5e95-481db0b23936@bernhard-voelker.de> From: =?UTF-8?Q?P=c3=a1draig_Brady?= Message-ID: <77a5ddbf-d589-804b-31a1-ec0dd24b0ead@draigBrady.com> Date: Mon, 27 Nov 2017 10:21:11 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <4231e350-b22b-091e-5e95-481db0b23936@bernhard-voelker.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 21760 Cc: Ian Jackson X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On 27/11/17 07:18, Bernhard Voelker wrote: > [sending again, because the first try came back with some unclear > error message, and the message didn't show up on the ML so far.] > > On 11/24/2017 02:48 AM, Pádraig Brady wrote: >> Pushed with those improvements. > > Sorry, this comes a bit late. > > That change only added support for the long option, so the attached > makes timeout also recognize the short -v option as advertized in > usage+texi. Blush. Please apply. > BTW: what do you think about a new syntax-check rule to verify that > all options in usage are actually supported? > Some of the option checks for some utilities might become complicated, > but maybe still worth ... I've caught this particular issue myself in a couple of patches from others, so I'll write a syntax check later today hopefully. thanks! Pádraig From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 27 19:06:47 2017 Received: (at 21760) by debbugs.gnu.org; 28 Nov 2017 00:06:47 +0000 Received: from localhost ([127.0.0.1]:33221 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJTQ5-00057S-Bo for submit@debbugs.gnu.org; Mon, 27 Nov 2017 19:06:46 -0500 Received: from mout.kundenserver.de ([212.227.126.131]:57423) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJTQ0-00057A-9H for 21760@debbugs.gnu.org; Mon, 27 Nov 2017 19:06:35 -0500 Received: from [192.168.101.10] ([91.12.175.109]) by mrelayeu.kundenserver.de (mreue003 [212.227.15.167]) with ESMTPSA (Nemesis) id 0Liq3V-1epVRZ3ebF-00d0xp; Tue, 28 Nov 2017 01:06:21 +0100 Subject: Re: bug#21760: timeout: Feature Request: --verbose ==> output if timeout To: =?UTF-8?Q?P=c3=a1draig_Brady?= , Jim Meyering , 21760@debbugs.gnu.org, =?UTF-8?Q?Thomas_G=c3=bcttler?= References: <562E00CC.7060307@thomas-guettler.de> <22994.18304.789921.177698@chiark.greenend.org.uk> <1898e77e-28b1-b395-d5ad-b5534ee8c230@draigBrady.com> <5bbcf26c-71e9-d27f-f6b6-44785743e607@draigBrady.com> <4231e350-b22b-091e-5e95-481db0b23936@bernhard-voelker.de> <77a5ddbf-d589-804b-31a1-ec0dd24b0ead@draigBrady.com> From: Bernhard Voelker Message-ID: <5051b0b2-3858-4781-87f6-77cc9090fe4e@bernhard-voelker.de> Date: Tue, 28 Nov 2017 01:06:18 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <77a5ddbf-d589-804b-31a1-ec0dd24b0ead@draigBrady.com> Content-Type: multipart/mixed; boundary="------------7253E819445C5783C0C28881" Content-Language: en-US X-Provags-ID: V03:K0:MoLRTZlvS6LO34I6QNBpVN6yFryjEpqxoh0qWyj1ZlJJFnC/Fxc c5rE19qLS+8iS1n+RsAjEVF+bkszmj2ryBUDDbpa5jz9mjBoJSpPI0YGdHUGnU/fxVMfQJO 5CvWVvpIcUBa4aRLPTDi0kHlMRk2tNEQiLQA46XBXTCkVzJ0NVABmkIociRWT65MVxhe2Nd 5WmZx7qd9OQr9YtQCCAgw== X-UI-Out-Filterresults: notjunk:1;V01:K0:OsMZ/Zn7F3w=:QdFw56nY4Q92jYYUw9d+NX nuZVn2nthezhjj+8nHYITpDbpj7Nkji83LVQiliLXxNR1+Flth8WDCKp9mULYhl71g3ntB8E+ XchKqgzMlqIRImPXHJV1ghJXH/yopD1MqVRe/8fDfLdGBJZhGcDYPentFUGcDMrE9F3N12ART 3XYdV3FredOERX77/3JwNzbLrHh/nWSJXG8oD4xfUD3Zwf53ajrQZj4vNqDzEbNimppL2/zzH fHLgl8vbJ6DsZCYJpKDfYRwMseZDYmuwomCItffSwxrubv0H8A0K8b8e5nBn4kG+81ai0AYe/ KZ8no2ydlKGOQLF4T1EvkxKOuWhMQT5aXHobJhnVpBXLvjw2kuUT0W0kyzAGM2HZ7cbbdvQ6H iEvrRxIR9XKrM713dpDNLRmm3jbSZob0HIYLKC6kJNnUpPvLRvb6U+H0xatybHlivvu1VPb1N I3B4hoQiClD2gcBjUQn0A+HRKNgusz/kY5XHlSwIH1A18ZCMeQRbRvRrPI1YOz3j95U8cOuPV k5WogzTQ7oMPuDuj3wFEF6fn+FjkrPKCjM+vrSqXBDvWctKJZfzhWVfCCYJaS4+N55BdYCQZj m0GWqy9+0gSgE8dGYHLRmHz3mxhrnxEx2alj/BSmKaG/ir47f1ciZb0X75VrAgg7O25CeA8tl FSjKuafWmLploybwyGlmR27mFnZpOoHaxGOgaIx8Np04B89m/7UKtkvr1R/Vw2yk0qeTCu/sE hr+T9Af4htPckVy3Uebf/sGeemdC/QquNX05MQ== X-Spam-Score: -0.1 (/) X-Debbugs-Envelope-To: 21760 Cc: Ian Jackson X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) This is a multi-part message in MIME format. --------------7253E819445C5783C0C28881 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 11/27/2017 07:21 PM, Pádraig Brady wrote: > Blush. Please apply. Thanks, pushed. >> BTW: what do you think about a new syntax-check rule to verify that >> all options in usage are actually supported? >> Some of the option checks for some utilities might become complicated, >> but maybe still worth ... > > I've caught this particular issue myself in a couple of patches from others, > so I'll write a syntax check later today hopefully. I've also played a bit ... and it turned out to become a regular test instead of a syntax-check rule. It's a draft, and I only tested here on openSUSE:Tumbleweed, but at least it seems to be a good start. Maybe it should be marked as expensive. Have a nice day, Berny --------------7253E819445C5783C0C28881 Content-Type: text/x-patch; name="0001-tests-verify-usage-vs.-getopt-DRAFT.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-tests-verify-usage-vs.-getopt-DRAFT.patch" >From 0220fab9f0dfb2eb1849f07a33198f4923bc2abf Mon Sep 17 00:00:00 2001 From: Bernhard Voelker Date: Mon, 27 Nov 2017 23:46:51 +0100 Subject: [PATCH] tests: verify usage vs. getopt [DRAFT] * tests/misc/usage_vs_getopt.sh: Add test. * tests/local.mk (all_tests): Reference it. --- tests/local.mk | 1 + tests/misc/usage_vs_getopt.sh | 101 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+) create mode 100755 tests/misc/usage_vs_getopt.sh diff --git a/tests/local.mk b/tests/local.mk index 8ee7c5039..612316b61 100644 --- a/tests/local.mk +++ b/tests/local.mk @@ -422,6 +422,7 @@ all_tests = \ tests/misc/truncate-relative.sh \ tests/misc/tsort.pl \ tests/misc/tty.sh \ + tests/misc/usage_vs_getopt.sh \ tests/misc/unexpand.pl \ tests/misc/uniq.pl \ tests/misc/uniq-perf.sh \ diff --git a/tests/misc/usage_vs_getopt.sh b/tests/misc/usage_vs_getopt.sh new file mode 100755 index 000000000..923bb30ec --- /dev/null +++ b/tests/misc/usage_vs_getopt.sh @@ -0,0 +1,101 @@ +#!/bin/sh +# Verify that all options mentioned in usage are recognized by getopt. + +# Copyright (C) 2017 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src + +checkprg () { + prg="$1" + + # Get stderr output for unrecognized options. + rcexp=1 + case "$prg" in + expr ) rcexp=0 ;; + dir | ls | printenv | sort | tty | vdir ) rcexp=2 ;; + env | chroot | nice | nohup | stdbuf | timeout ) rcexp=125 ;; + esac + returns_ $rcexp $prg --thisoptiondoesnotexist >/dev/null 2> exp1 || fail=1 + sed 's/--thisoptiondoesnotexist/OPT/' < exp1 > expl || framework_failure_ + returns_ $rcexp $prg -/ >/dev/null 2> exp2 || fail=1 + sed "s/'\/'/'OPT'/" < exp2 > exps || framework_failure_ + + # Get output for --help. + $prg --help > help || fail=1 + + # Get list of options of the utility, including --help but stopping + # at --version to avoid to get lines with explanations below the options + # list like e.g. in 'cut --help | grep -F -- "-M"'. + awk '/^[ ]*--version/ { exit; } + /^[ ]*-/ { + for(i=1;i<=NF;i++) { + if (substr($i,1,1)!="-") + break; + print gensub(/[[,=].*$/,"",1,$i) + } + } + ' help \ + | grep . > opts || framework_failure_ + + # Test all options mentioned in usage (but --version). + while read opt; do + test "x$opt" = 'x--help' \ + && continue + # Append --help to be on the safe side: the option either requires + # a further argument, or --help triggers usage(); so $prg should + # exit with failure in any case. + # Add a 2nd --help for the 'env -u --help' case. + $prg "$opt" --help --help out 2>err1 + rc=$? + # In the --help case, the exit code should have been 0. + if [ $rc = 0 ]; then + compare help out || fail=1 + else + # Catch false positives. + case "$prg/$opt" in + 'pr/-COLUMN') continue;; + esac + # Else $prg should have complained about a missing argument. + # Replace $opt in stderr output by the neutral placeholder. + # Differentiate between long vs. short option error messages. + # Fail if the stderr output is identical to the above provoked error. + case "$opt" in + '--'*) + sed "s/$opt/OPT/" < err1 > err || framework_failure_ + compare expl err && { fail=1; cat err1; } + ;; + *) + sed "s/'.'/'OPT'/" < err1 > err || framework_failure_ + compare exps err && { fail=1; cat err1; } + ;; + esac + fi + done < opts +} + +for prg in $built_programs; do + case "$prg" in + # Skip some utilities entirely. + '[' ) + continue;; + # Wrap some utilities known by the shell by env. + echo | false | kill | printf | pwd | test | true ) + prg="env $prg";; + esac + checkprg $prg +done + +Exit $fail -- 2.15.0 --------------7253E819445C5783C0C28881-- From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 28 05:03:34 2017 Received: (at 21760) by debbugs.gnu.org; 28 Nov 2017 10:03:34 +0000 Received: from localhost ([127.0.0.1]:33502 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJcjm-0006Ox-26 for submit@debbugs.gnu.org; Tue, 28 Nov 2017 05:03:34 -0500 Received: from mail.magicbluesmoke.com ([82.195.144.49]:57886) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJcjk-0006Op-CE for 21760@debbugs.gnu.org; Tue, 28 Nov 2017 05:03:32 -0500 Received: from localhost.localdomain (c-73-158-116-184.hsd1.ca.comcast.net [73.158.116.184]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.magicbluesmoke.com (Postfix) with ESMTPSA id 2C5E59954; Tue, 28 Nov 2017 10:03:30 +0000 (GMT) Subject: Re: bug#21760: timeout: Feature Request: --verbose ==> output if timeout To: Bernhard Voelker , Jim Meyering , 21760@debbugs.gnu.org, =?UTF-8?Q?Thomas_G=c3=bcttler?= References: <562E00CC.7060307@thomas-guettler.de> <22994.18304.789921.177698@chiark.greenend.org.uk> <1898e77e-28b1-b395-d5ad-b5534ee8c230@draigBrady.com> <5bbcf26c-71e9-d27f-f6b6-44785743e607@draigBrady.com> <4231e350-b22b-091e-5e95-481db0b23936@bernhard-voelker.de> <77a5ddbf-d589-804b-31a1-ec0dd24b0ead@draigBrady.com> <5051b0b2-3858-4781-87f6-77cc9090fe4e@bernhard-voelker.de> From: =?UTF-8?Q?P=c3=a1draig_Brady?= Message-ID: <70914806-fd13-5667-c8d7-514cd17948d7@draigBrady.com> Date: Tue, 28 Nov 2017 02:03:27 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <5051b0b2-3858-4781-87f6-77cc9090fe4e@bernhard-voelker.de> Content-Type: multipart/mixed; boundary="------------F00A0F6FA674EFAFBB5B4482" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 21760 Cc: Ian Jackson X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) This is a multi-part message in MIME format. --------------F00A0F6FA674EFAFBB5B4482 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit On 27/11/17 16:06, Bernhard Voelker wrote: > On 11/27/2017 07:21 PM, Pádraig Brady wrote: >> Blush. Please apply. > > Thanks, pushed. > >>> BTW: what do you think about a new syntax-check rule to verify that >>> all options in usage are actually supported? >>> Some of the option checks for some utilities might become complicated, >>> but maybe still worth ... >> >> I've caught this particular issue myself in a couple of patches from others, >> so I'll write a syntax check later today hopefully. > > I've also played a bit ... and it turned out to become a regular > test instead of a syntax-check rule. > It's a draft, and I only tested here on openSUSE:Tumbleweed, > but at least it seems to be a good start. Maybe it should be > marked as expensive. Cool stuff. This correlates a lot of things. It's not that expensive really. Takes about 9s on my oldish laptop. This would be the first real use of awk (I notice one other test using gawk which I'll change to using something else). Attached is a diff to change to using sed. Also it simplifies the subsequent sed calls to avoid the separate cases. thanks! Pádraig --------------F00A0F6FA674EFAFBB5B4482 Content-Type: text/x-patch; name="getopt-sed.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="getopt-sed.diff" diff --git a/src/readlink.c b/src/readlink.c index abbd352..6b41f79 100644 --- a/src/readlink.c +++ b/src/readlink.c @@ -78,7 +78,7 @@ usage (int status) \n\ without requirements on components exist= ence\n\ -n, --no-newline do not output the trailing delimiter\n\ - -q, --quiet,\n\ + -q, --quiet\n\ -s, --silent suppress most error messages (on by defa= ult)\n\ -v, --verbose report error messages\n\ -z, --zero end each output line with NUL, not newli= ne\n\ diff --git a/tests/misc/usage_vs_getopt.sh b/tests/misc/usage_vs_getopt.s= h index 923bb30..09b97d9 100755 --- a/tests/misc/usage_vs_getopt.sh +++ b/tests/misc/usage_vs_getopt.sh @@ -36,19 +36,9 @@ checkprg () { # Get output for --help. $prg --help > help || fail=3D1 =20 - # Get list of options of the utility, including --help but stopping - # at --version to avoid to get lines with explanations below the optio= ns - # list like e.g. in 'cut --help | grep -F -- "-M"'. - awk '/^[ ]*--version/ { exit; } - /^[ ]*-/ { - for(i=3D1;i<=3DNF;i++) { - if (substr($i,1,1)!=3D"-") - break; - print gensub(/[[,=3D].*$/,"",1,$i) - } - } - ' help \ - | grep . > opts || framework_failure_ + sed -n -e '/--version/q' \ + -e 's/^ \{2,6\}-/-/; s/ .*//; s/[=3D[].*//; s/, /\'$'\n''/g; s/^-/-= /p' help \ + > opts || framework_failure_ =20 # Test all options mentioned in usage (but --version). while read opt; do @@ -72,16 +62,7 @@ checkprg () { # Replace $opt in stderr output by the neutral placeholder. # Differentiate between long vs. short option error messages. # Fail if the stderr output is identical to the above provoked err= or. - case "$opt" in - '--'*) - sed "s/$opt/OPT/" < err1 > err || framework_failure_ - compare expl err && { fail=3D1; cat err1; } - ;; - *) - sed "s/'.'/'OPT'/" < err1 > err || framework_failure_ - compare exps err && { fail=3D1; cat err1; } - ;; - esac + sed -e "s/$opt/OPT/" -e "s/'.'/'OPT'/" < err1 > err || framework_f= ailure_ fi done < opts } --------------F00A0F6FA674EFAFBB5B4482-- From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 28 17:48:28 2017 Received: (at 21760) by debbugs.gnu.org; 28 Nov 2017 22:48:28 +0000 Received: from localhost ([127.0.0.1]:35272 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJofq-0007Rq-Ep for submit@debbugs.gnu.org; Tue, 28 Nov 2017 17:48:28 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:64738) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJofl-0007RY-DY for 21760@debbugs.gnu.org; Tue, 28 Nov 2017 17:48:16 -0500 Received: from [192.168.101.10] ([91.12.175.109]) by mrelayeu.kundenserver.de (mreue103 [212.227.15.183]) with ESMTPSA (Nemesis) id 0LuKFr-1fIL4O0xzr-011jdi; Tue, 28 Nov 2017 23:48:03 +0100 Subject: Re: bug#21760: timeout: Feature Request: --verbose ==> output if timeout To: =?UTF-8?Q?P=c3=a1draig_Brady?= , Jim Meyering , 21760@debbugs.gnu.org, =?UTF-8?Q?Thomas_G=c3=bcttler?= References: <562E00CC.7060307@thomas-guettler.de> <22994.18304.789921.177698@chiark.greenend.org.uk> <1898e77e-28b1-b395-d5ad-b5534ee8c230@draigBrady.com> <5bbcf26c-71e9-d27f-f6b6-44785743e607@draigBrady.com> <4231e350-b22b-091e-5e95-481db0b23936@bernhard-voelker.de> <77a5ddbf-d589-804b-31a1-ec0dd24b0ead@draigBrady.com> <5051b0b2-3858-4781-87f6-77cc9090fe4e@bernhard-voelker.de> <70914806-fd13-5667-c8d7-514cd17948d7@draigBrady.com> From: Bernhard Voelker Message-ID: <0bfcb7a8-947c-74dd-a8bf-d212124a34be@bernhard-voelker.de> Date: Tue, 28 Nov 2017 23:48:00 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <70914806-fd13-5667-c8d7-514cd17948d7@draigBrady.com> Content-Type: multipart/mixed; boundary="------------3099D0AF17A914427E5148F5" Content-Language: en-US X-Provags-ID: V03:K0:0DdpnBJn1fTooYt/lzvydYSX634HECPfQVf2BCUi1l65aOSbHdd iHM5rvOWSlfgeG/0FCnF5aQezBkvjKNZMB2FN7i7IxJYkBT4SIt6H+g3VcxlogHMc23rP7y 9kDbwEPkY9Jhj454CvnWUwjwVYnAiS1/R0VME/lsDTQK6wmM4TAvG9if3Mpai4nlLKSi1/A u4F4H1RigwnVB8EdLwFQQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:tiVHxdPjrk4=:orMkecejL0gipw01szJTuk DVTLHh6zthpRLYUx6InSocwYni2YqLFf43Gc5HM4UE57086oywzteKK94jRtk2zJUP4k+bgBB tTuPgYK7PA+eHFSOd3llgy1Kx+xQ+U3ezk44oL4ZDfDpGxKxPbwQAYWinX1uHgTO/Wicyl0Oi CBhc8uz89/L6vavQJ4qWa/RITI+64JTYxJdGldDRpJf3tbX2Ei5V2rkgfkfYoGfLqiwyotAGQ uYbhchDl0k5IYn25bD1yrPn69Piob6I0L52yfoPzSTpxkfkzjRaJ7eibZA3CA7Dueeyxt8gmL +FjrWyVbkMRSoYG/K9MgrLqOjXFioNE/emISO8R+4n7ZmisFvfn6qXOp/++RlJd7y3VGbrj1U Em0shjkftaig7QryYdLdPz5eMgSUsQkd4Bubimza8nxlW7TPPctZ0LS9vLB3AvxyRR3E2Ehmd iawgeh3ZV7gBUipG1a7YfwR2hsNom7m3KTtIpgzSjaidyvc7rpnLeWyOarl2kygNpD5pTos6A bXFmyFvjmG6wFvCdkYTl/ZUL1jMpLCU4wrKs/6pTGW8SwTnkUao9Xh6z4e/AyTQZ3hJ2gDYQ5 U2rg738PV8iBugpAdQ9oI9jr9PFldbuwSJ5ZHb61vmkTjOGvdRLGY5WaxGsUjimE1RcAamJ14 CisXZwmhu+9wrwy2g3ZnKSsRlJBpyQSJeLwjrO3W73A4XgfxOeHYj+hP9OiuzcP4fBDzn3lS/ g9JtEycVKdBpvSNN9RxV6AUgh3huRU/ieeKtlg== X-Spam-Score: -0.1 (/) X-Debbugs-Envelope-To: 21760 Cc: Ian Jackson X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) This is a multi-part message in MIME format. --------------3099D0AF17A914427E5148F5 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 11/28/2017 11:03 AM, Pádraig Brady wrote: > Attached is a diff to change to using sed. Thanks, I merged your changes. Please note that this new check only works with the patch applied discussed at: http://lists.gnu.org/archive/html/coreutils/2017-11/msg00037.html Thanks & have a nice day, Berny --------------3099D0AF17A914427E5148F5 Content-Type: text/x-patch; name="0001-readlink-remove-superfluous-comma-from-usage-output.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-readlink-remove-superfluous-comma-from-usage-output.pat"; filename*1="ch" >From ba8c567cf05f4a53c9d9a1a56cc21d39aef71354 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Tue, 28 Nov 2017 23:34:41 +0100 Subject: [PATCH 1/2] readlink: remove superfluous comma from usage output * src/readlink.c (usage): Remove ',' after --quiet option. --- src/readlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/readlink.c b/src/readlink.c index abbd35237..6b41f79a4 100644 --- a/src/readlink.c +++ b/src/readlink.c @@ -78,7 +78,7 @@ usage (int status) \n\ without requirements on components existence\n\ -n, --no-newline do not output the trailing delimiter\n\ - -q, --quiet,\n\ + -q, --quiet\n\ -s, --silent suppress most error messages (on by default)\n\ -v, --verbose report error messages\n\ -z, --zero end each output line with NUL, not newline\n\ -- 2.15.0 --------------3099D0AF17A914427E5148F5 Content-Type: text/x-patch; name="0002-tests-verify-usage-vs.-getopt.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="0002-tests-verify-usage-vs.-getopt.patch" >From 28760943767c521940855715eb245518bb26d2ff Mon Sep 17 00:00:00 2001 From: Bernhard Voelker Date: Mon, 27 Nov 2017 23:46:51 +0100 Subject: [PATCH 2/2] tests: verify usage vs. getopt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Verify that all options mentioned in usage are actually recognized by the program. * tests/misc/usage_vs_getopt.sh: Add test. * tests/local.mk (all_tests): Reference it. Co-authored-by: Pádraig Brady --- tests/local.mk | 1 + tests/misc/usage_vs_getopt.sh | 92 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+) create mode 100755 tests/misc/usage_vs_getopt.sh diff --git a/tests/local.mk b/tests/local.mk index 8ee7c5039..612316b61 100644 --- a/tests/local.mk +++ b/tests/local.mk @@ -422,6 +422,7 @@ all_tests = \ tests/misc/truncate-relative.sh \ tests/misc/tsort.pl \ tests/misc/tty.sh \ + tests/misc/usage_vs_getopt.sh \ tests/misc/unexpand.pl \ tests/misc/uniq.pl \ tests/misc/uniq-perf.sh \ diff --git a/tests/misc/usage_vs_getopt.sh b/tests/misc/usage_vs_getopt.sh new file mode 100755 index 000000000..1d6cf9242 --- /dev/null +++ b/tests/misc/usage_vs_getopt.sh @@ -0,0 +1,92 @@ +#!/bin/sh +# Verify that all options mentioned in usage are recognized by getopt. + +# Copyright (C) 2017 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src + +checkprg () { + prg="$1" + + # Get stderr output for unrecognized options for later use as a pattern. + # Also consider the expected exit status of each program. + rcexp=1 + case "$prg" in + dir | ls | printenv | sort | tty | vdir ) rcexp=2 ;; + env | chroot | nice | nohup | stdbuf | timeout ) rcexp=125 ;; + esac + # Write the pattern for a long, unknown option into a pattern file. + o='thisoptiondoesnotexist' + returns_ $rcexp $prg --$o >/dev/null 2> err || fail=1 + grep -F "$o" err || framework_failure_ + sed -n "1s/--$o/OPT/p" < err > pat || framework_failure_ + + # Append the pattern for a short unkown option. + returns_ $rcexp $prg -/ >/dev/null 2> err || fail=1 + grep -F "'/'" err || framework_failure_ + sed -n "1s/'\/'/'OPT'/p" < err >> pat || framework_failure_ + + # Get output for --help. + $prg --help > help || fail=1 + + # Extract all options mention in the above --help output. + sed -n -e '/--version/q' \ + -e 's/^ \{2,6\}-/-/; s/ .*//; s/[=[].*//; s/, /\'$'\n''/g; s/^-/-/p' help \ + > opts || framework_failure_ + cat opts # for debugging purposes + + # Test all options mentioned in usage (but --version). + while read opt; do + test "x$opt" = 'x--help' \ + && continue + # Append --help to be on the safe side: the option under test either + # requires a further argument, or --help triggers usage(); so $prg should + # exit without performing its regular operation. + # Add a 2nd --help for the 'env -u --help' case. + $prg "$opt" --help --help out 2>err1 + rc=$? + # In the --help case, i.e., when the option under test has been accepted, + # the exit code should be Zero. + if [ $rc = 0 ]; then + compare help out || fail=1 + else + # Else $prg should have complained about a missing argument. + # Catch false positives. + case "$prg/$opt" in + 'pr/-COLUMN') continue;; + esac + # Replace $opt in stderr output by the neutral placeholder. + # Handle both long and short option error messages. + sed -e "s/$opt/OPT/" -e "s/'.'/'OPT'/" < err1 > err || framework_failure_ + # Fail if the stderr output matches the above provoked error. + grep -Ff pat err && { fail=1; cat err1; } + fi + done < opts +} + +for prg in $built_programs; do + case "$prg" in + # Skip utilities entirely which have special option parsing. + '[' | expr | stty ) + continue;; + # Wrap some utilities known by the shell by env. + echo | false | kill | printf | pwd | test | true ) + prg="env $prg";; + esac + checkprg $prg +done + +Exit $fail -- 2.15.0 --------------3099D0AF17A914427E5148F5-- From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 29 00:43:15 2017 Received: (at 21760) by debbugs.gnu.org; 29 Nov 2017 05:43:15 +0000 Received: from localhost ([127.0.0.1]:35556 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJv9O-0001hv-UO for submit@debbugs.gnu.org; Wed, 29 Nov 2017 00:43:15 -0500 Received: from mail.magicbluesmoke.com ([82.195.144.49]:39378) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJv9L-0001hl-PM for 21760@debbugs.gnu.org; Wed, 29 Nov 2017 00:43:12 -0500 Received: from localhost.localdomain (c-73-158-116-184.hsd1.ca.comcast.net [73.158.116.184]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.magicbluesmoke.com (Postfix) with ESMTPSA id 920409569; Wed, 29 Nov 2017 05:43:09 +0000 (GMT) Subject: Re: bug#21760: timeout: Feature Request: --verbose ==> output if timeout To: Bernhard Voelker , Jim Meyering , 21760@debbugs.gnu.org, =?UTF-8?Q?Thomas_G=c3=bcttler?= References: <562E00CC.7060307@thomas-guettler.de> <22994.18304.789921.177698@chiark.greenend.org.uk> <1898e77e-28b1-b395-d5ad-b5534ee8c230@draigBrady.com> <5bbcf26c-71e9-d27f-f6b6-44785743e607@draigBrady.com> <4231e350-b22b-091e-5e95-481db0b23936@bernhard-voelker.de> <77a5ddbf-d589-804b-31a1-ec0dd24b0ead@draigBrady.com> <5051b0b2-3858-4781-87f6-77cc9090fe4e@bernhard-voelker.de> <70914806-fd13-5667-c8d7-514cd17948d7@draigBrady.com> <0bfcb7a8-947c-74dd-a8bf-d212124a34be@bernhard-voelker.de> From: =?UTF-8?Q?P=c3=a1draig_Brady?= Message-ID: <5c90924d-4c69-2279-1f30-605124c4f7fc@draigBrady.com> Date: Tue, 28 Nov 2017 21:43:07 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <0bfcb7a8-947c-74dd-a8bf-d212124a34be@bernhard-voelker.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 21760 Cc: Ian Jackson X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On 28/11/17 14:48, Bernhard Voelker wrote: > On 11/28/2017 11:03 AM, Pádraig Brady wrote: >> Attached is a diff to change to using sed. > > Thanks, I merged your changes. > > Please note that this new check only works with the patch applied > discussed at: > http://lists.gnu.org/archive/html/coreutils/2017-11/msg00037.html > +1 thanks again, Pádraig From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 29 08:19:35 2017 Received: (at 21760) by debbugs.gnu.org; 29 Nov 2017 13:19:35 +0000 Received: from localhost ([127.0.0.1]:35771 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eK2H1-0006GF-CW for submit@debbugs.gnu.org; Wed, 29 Nov 2017 08:19:35 -0500 Received: from mout.kundenserver.de ([212.227.126.135]:57136) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eK2Gz-0006G3-UK for 21760@debbugs.gnu.org; Wed, 29 Nov 2017 08:19:34 -0500 Received: from [10.0.2.15] ([62.153.148.194]) by mrelayeu.kundenserver.de (mreue001 [212.227.15.167]) with ESMTPSA (Nemesis) id 0Mfe8p-1eUogS1gqZ-00P9h7; Wed, 29 Nov 2017 14:19:23 +0100 Subject: Re: bug#21760: timeout: Feature Request: --verbose ==> output if timeout To: =?UTF-8?Q?P=c3=a1draig_Brady?= , Jim Meyering , 21760@debbugs.gnu.org, =?UTF-8?Q?Thomas_G=c3=bcttler?= References: <562E00CC.7060307@thomas-guettler.de> <22994.18304.789921.177698@chiark.greenend.org.uk> <1898e77e-28b1-b395-d5ad-b5534ee8c230@draigBrady.com> <5bbcf26c-71e9-d27f-f6b6-44785743e607@draigBrady.com> <4231e350-b22b-091e-5e95-481db0b23936@bernhard-voelker.de> <77a5ddbf-d589-804b-31a1-ec0dd24b0ead@draigBrady.com> <5051b0b2-3858-4781-87f6-77cc9090fe4e@bernhard-voelker.de> <70914806-fd13-5667-c8d7-514cd17948d7@draigBrady.com> <0bfcb7a8-947c-74dd-a8bf-d212124a34be@bernhard-voelker.de> <5c90924d-4c69-2279-1f30-605124c4f7fc@draigBrady.com> From: Bernhard Voelker Message-ID: <5d4ac953-33dc-5453-f40e-ece5fa36e450@bernhard-voelker.de> Date: Wed, 29 Nov 2017 14:19:15 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <5c90924d-4c69-2279-1f30-605124c4f7fc@draigBrady.com> Content-Type: text/plain; charset=utf-8 Content-Language: de-DE-1901 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:75Dt9qX/wKOgR2g/pOIq15N/ZHKMubNGEAsupoanDH+7aI4i1LJ edvjNfY4cv/akNuhf0DEO6TCBdi3Ey8nXd+H8S7VS9RY2bkD1gDmkh8XqGNtLYC9dMo9YdV +0gT6cMYFOIgBUpkPin1kT8Kz4krFl4Nj8C/QSQcjrKpthTWwLrR4wq66ljKnTnjAnhEci6 LDwNmLWwCQ+neQmVtMxMA== X-UI-Out-Filterresults: notjunk:1;V01:K0:QBh9fyv/S9o=:G9ZYRDyu8DSmtDZd2dV0ec rwTn/xSjetCzWuNkrMNjPzQnGxmNoXQqCt6yFQLRODpXrn/L6fBHX7SJ6ZPQpClt9tYkNCs5+ 4rK0zDkVxHMV1hHBE1cPoo5Q7DWFkDqpRQm7noMkyg6iNgscmVj9zrjyanoekssvZFjSzzbpP dS1YFGSpu69WRSwZecsg8DH3RAlN3yC5U2LwruL/oUY5gfn6pcntvLDDnS4jcKL3oKWOyMdEh nKrsdXhLVBvV7EsOUTJvPHBPBuTxYQtdYhb1fqQJ1UuOU/cfUBdDThjal52EqVSjl43pbV6en aR7E0QCnneXeif4giqCWge0kHULtbTZruaebj6NCyH655lopjEE3MWdH+m9Wm+jTEJx7nOnaE MFZmDPmc6nPhB1AwnxVU2K5R6HB4C1giBdop4VPgphqislXgPcHDksvZF1QWRHpfHUqAVdrAU R2uyM9h5OWV35d7aFPwtNMTgnvkElDFLJdTcc524vrhPiuZap8HhaDhaUpfJKB5U89VALFjDB PyZ9BmP7sM6ZY+qk6EXb9a14TLquFCWaSM1rlzSq4Hx0EZEFWnvM+CEK91Un+YpfP59+5uNdr MghqBHmBGLQw7cwDNgbmd9UWyrr+m3jJHWJSiJeKlcmFjiwciRoWtwT94dQEFNHXXIK5627Ma dk2s4itDn/phOppn3Ode45b35oRCCdrkklZGgfUd6Og2wNFXgykKqS1MINyDm2Xd9zsXmKMJ8 CpYUkWYnqK1A9QDZsmY39Y3kBIcUuXgM19yABBXrN8JL2AB5K8twtfr7Rtg= X-Spam-Score: -0.1 (/) X-Debbugs-Envelope-To: 21760 Cc: Ian Jackson X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) On 11/29/2017 06:43 AM, Pádraig Brady wrote: > +1 Thanks, pushed at: https://git.sv.gnu.org/cgit/coreutils.git/commit/?id=052cce9e3e92 Have a nice day, Berny From unknown Sat Aug 16 16:17:53 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 28 Dec 2017 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator