From owner-freebsd-current@FreeBSD.ORG Fri Feb 3 10:01:48 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 17BFB16A420 for ; Fri, 3 Feb 2006 10:01:48 +0000 (GMT) (envelope-from mime@traveller.cz) Received: from ss.eunet.cz (ss.eunet.cz [193.85.228.13]) by mx1.FreeBSD.org (Postfix) with ESMTP id 32E6E43D53 for ; Fri, 3 Feb 2006 10:01:36 +0000 (GMT) (envelope-from mime@traveller.cz) Received: from localhost.i.cz (ss.eunet.cz [193.85.228.13]) by ss.eunet.cz (8.13.3/8.13.1) with ESMTP id k13A1YMt032483 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Fri, 3 Feb 2006 11:01:35 +0100 (CET) (envelope-from mime@traveller.cz) From: Michal Mertl To: freebsd-current@freebsd.org In-Reply-To: <1138922988.10456.29.camel@genius.i.cz> References: <1138922988.10456.29.camel@genius.i.cz> Content-Type: text/plain; charset=ISO-8859-2 Date: Fri, 03 Feb 2006 11:01:28 +0100 Message-Id: <1138960889.17667.33.camel@genius.i.cz> Mime-Version: 1.0 X-Mailer: Evolution 2.4.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 8bit Subject: Re: buglets with pts - with patch X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2006 10:01:48 -0000 Michal Mertl píše v pá 03. 02. 2006 v 00:29 +0100: > I found a couple of display issues with the new pts type ptys. > > wall and who - don't check the utmp tty validity (see also PR bin/84041) > The attached patch duplicates the check from the w program in who and > wall. For some reason closed pts ttys are displayed/printed to when > there wasn't a problem with the old pty implementation. I forgot to properly describe the bug :-). who and wall displays/prints to already detached pty. E.g. I open an gnome-terminal window and close it. Then when I call who in another window the just closed pty is listed as active. Example: ------ mime@genius /usr/home/mime$ who mime pts/1 1 úno 18:50 (:0.0) mime pts/2 2 úno 01:54 (:0.0) mime pts/3 2 úno 16:06 (:0.0) mime pts/4 2 úno 16:44 (:0.0) mime pts/5 2 úno 23:21 (:0.0) mime :0 1 úno 18:46 ------ mime@genius /usr/home/mime$ wall a Broadcast Message from mime@genius... (/dev/pts/4) at 10:20 CET... a wall: /dev/pts/5: No such file or directory wall: /dev/:0: No such file or directory ---- "w" is correct: ------ mime@genius /usr/home/mime$ w 10:20dp up 1 day, 9:26, 4 users, load averages: 0,98 0,45 0,38 USER TTY FROM LOGIN@ IDLE WHAT mime pts/1 :0.0 st06od 31 bash mime pts/2 :0.0 čt01dp 31 ssh .. mime pts/3 :0.0 čt04od 51 [ssh] mime pts/4 :0.0 čt04od - w ------ I also have just confirmed there is also one more bug - I don't see all the ptys - I probably didn't investigate it enough but it seems that pts/0 is never displayed by w, who or wall. It is correct is last output though and ps also shows the processes running on it. I think that whatever writes to /var/tmp/utmp doesn't write pts/0 lines to it (so w, who and wall don't see it) but they are written correctly to /var/log/wtmp (so last sees it). I see now that the patches I sent out aren't a complete solution too all the issues. I will continue looking into it. > > ps - the TT column displays garbage (always "pts") > The attached patch trims "pts/" from the tty name. The printout doesn't > look nice ("10443 pts IWs 0:00,00 bash" changes to "10443 3 IWs > 0:00,00 bash") but the field width is 4 which doesn't allow much. The > right solution would probably involve removing TT column and always use > the longer version TTY with width of 8 (which allows to correctly > display "pts/3"). I checked Solaris 10 and it displays the full tty name > by default. > > Regards > > Michal