From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 8937513888F for ; Tue, 20 Oct 2015 18:19:33 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 518E521C045; Tue, 20 Oct 2015 18:19:22 +0000 (UTC) Received: from mail.muc.de (mail.muc.de [193.149.48.3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id BFE0C21C03B for ; Tue, 20 Oct 2015 18:19:20 +0000 (UTC) Received: (qmail 58362 invoked by uid 3782); 20 Oct 2015 18:19:18 -0000 Received: from acm.muc.de (p548A5C6D.dip0.t-ipconnect.de [84.138.92.109]) by colin.muc.de (tmda-ofmipd) with ESMTP; Tue, 20 Oct 2015 20:19:17 +0200 Received: (qmail 7328 invoked by uid 1000); 20 Oct 2015 18:20:57 -0000 Date: Tue, 20 Oct 2015 18:20:57 +0000 To: Matthias Gerstner Cc: "gentoo-user@lists.gentoo.org" Subject: Re: [gentoo-user] Can I suppress the bleep when shutting down? Message-ID: <20151020182057.GB6901@acm.fritz.box> References: <20151020161029.GC1781@acm.fritz.box> <20151020182704.6f90804f@hal9000.localdomain> <20151020164439.GA6901@acm.fritz.box> <20151020172248.GA32751@mgpc.ncp.de> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151020172248.GA32751@mgpc.ncp.de> User-Agent: Mutt/1.5.23 (2014-03-12) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Archives-Salt: 16092b51-a54c-4dbb-b939-c5f233bf1698 X-Archives-Hash: f82a82954a927350926f822179d03a11 Hello, Matthias. On Tue, Oct 20, 2015 at 07:22:48PM +0200, Matthias Gerstner wrote: > Hi Alan, > > I simply want to disable that one particular beeping at shutdown time. > well this topic made me curious where the beep is coming from. > It does originate from the shutdown command itself which is part of the > sys-apps/sysvinit package. In this package's source you find can a file > "src/dowall.c", where you will in turn find a function "wall(...)". > This is the function where the warning messages will be produced that > show up in the terminal and the message is produced like this: > snprintf(line, sizeof(line), > "\007\r\nBroadcast message from %s@%s %s(%s):\r\n\r\n", > user, hostname, tty, date); > The "\007" is the beep you're getting. It's a bell character that you > can produce manually by doing this, too: > echo -e "\007" > Unfortunately the bell character is hard coded into the warning message. > Also there seems to be no way to suppress the warning message. > But you could still try is to disable the interpretation of the bell > character by your terminal. Then you could make an alias or wrapper > around the original shutdown command that does this. > According to Arch Linux docs here: > https://wiki.archlinux.org/index.php/Disable_PC_speaker_beep > You can locally disable the bell in the terminal by calling "setterm > -blength 0". But this doesn't work with my terminals. Says it's > unsupported. > Then you can put this in your ~/.inputrc: "set bell-style none". This > works for me. Then, however, all terminals stop beeping. The pcspkr is > still loaded though and can be used. > As you only want to stop the beep only during shutdown you might also be > able to call "xset -b", disabling the bell on the X-server (globally?). > This is not persistent across reboots and you won't have any beeps until > the machine shuts down. Hey, that's brilliant! Thank you very much indeed! That is an answer much more complete than I could have expected. Probably the most satisfactory way for me to make it work the way I want is to build my own version of shutdown, removing the offending \007 from that sprintf format string..... and then to watch out for new versions of sys-apps/sysvinit. The package appears to be relatively stable. > Regards > Matthias -- Alan Mackenzie (Nuremberg, Germany).