From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d4db,8b5986e030b5e330,start X-Google-Attributes: gid10d4db,public From: "Alan L. Wendt" Subject: agetty 1.9.1a Date: 1995/08/01 Message-ID: #1/1 X-Deja-AN: 107291031 followup-to: comp.os.linux.development.system content-type: text/plain; charset=ISO-8859-1 organization: EZLink Internet Access mime-version: 1.0 newsgroups: comp.os.linux.announce Briefly, there are a number of bugs in all the getty's. I've fixed (I think) the bugs in agetty-1.9.1 and I'm distributing it as agetty-1.9.1a via ftp from ezlink.com. At the same time I "fixed" agetty to accept port and speed-list in either order in /etc/inittab. What source is distributed as plain "getty"? I plan on fixing all these clydes and I'm not sure whether getty = agetty or uugetty or if there is a third source. Alan Wendt alan@ezlink.com --------------------------------------------------------------------- README.1.9.1a: The current getty's under Linux change the 2-character vector ut_id to be the first 2 characters of the line. This causes problems for 3-character names of ports such as ttyS20 because ttyS20, ttyS21, etc all get the same abbreviation. In addition, the utmp2.c file as distributed keys off ut_id to determine which utmp entry to replace in "setutent", so changing the ut_id field confuses setutent. These problems lead to only one such terminal being seen from "who", "finger", "talk", etc, as well as infinite growth of /etc/utmp. Init sets up ut_id from the 2-character key at the front of each line of the /etc/inittab file, and the mods to agetty in this directory cause agetty to leave that key untouched. The mods to agetty in this directory appear to fix the problems mentioned above. Running /usr/src/init/dump for the tty1 - tty6 console logins, we get the following: Utmp dump of stdin [5] [22634] [c1] Jul 27 13:32:59 [6] [22588] [c2] tty2 Jul 27 13:27:25 [6] [22589] [c3] tty3 Jul 27 13:27:29 [7] [22317] [c5] alan tty5 Jul 27 13:16:58 [6] [22718] [c4] tty4 Jul 27 13:43:25 [6] [22593] [c6] tty6 Jul 27 13:27:41 [5] [22724] [t8] Jul 27 13:43:36 [6] [22724] [ ] ttyC14 Jul 27 13:43:37 [0] [00000] [ ] Dec 31 17:00:00 [0] [00000] [ ] Dec 31 17:00:00 [0] [00000] [ ] Dec 31 17:00:00 [0] [00000] [ ] Dec 31 17:00:00 [0] [00000] [ ] Dec 31 17:00:00 [6] [22634] [1 ] tty1 Jul 27 13:33:00 This is showing alan logged in on tty5, with tty2, tty3, tty4, and tty6 waiting in agetty. The [5]'s are in init, [6]'s are getty/login, [7]'s are user processes, and [0]'s are free entries. It should be unusual to see a process in init if the terminal is enabled. The bizarre double entry for tty1 is caused because tty1 is handled by "getty", not agetty. Getty and uugetty have the same problems that agetty does. Similarly, the duplicate pid 22724 for ttyC14 is caused by uugetty. Note that utmp seems to be growing, in that there are 5 empty entries but tty1's entry got stuck at the end of the file. The released utmp2.c, in setutent, fails to find the entry for tty1 (because its searching for "1 " and the original entry was "c1") and so it adds another entry at the end of the file. Because pty's won't have unique ut_id's either, the regular utmp code won't work for them. I've added a "rewriteutent" call which just overwrites the last entry returned by getutent. This eliminates the sequential search that setutent was performing to match ut_id, so performance should be improved as well as reliability. This agetty can accept port and speed in either order. Alan Wendt alan@ezlink.com -- Send comp.os.linux.announce submissions to: linux-announce@news.ornl.gov PLEASE remember a short description of the software.