WMartin%office-3@sri-unix.UUCP (12/09/83)
From: Will Martin <WMartin@office-3> Hi! This will probably be perceived by any UNIX wizards out there as a very dumb group of questions. I guess my main problem here is not knowing where to look for printed or on-line documentation that answers my inquiry, so pointers to such will be appreciated. (My other problem is that the person I am most likely to ask about this is on vacation...) Anywho, the situation is as follows: We have a CCI Power-5 68000-based machine here, with 16 ports plus console port, which runs PERPOS, a UNIX look-alike devised by CCI, and on which we run the Office Power office automation software package. Hooked to this machine are 16 CCI terminals (made by Zentec) [including the console] and one system printer (currently a NEC Spinwriter 5510). The other day, merrily thrashing about as "root" with insufficient knowledge of what I was doing, I munged up the etc/ttys file. I restored it to what I thought was the correct form, re-wrote it out, and we tried printing something on the system printer. It worked fine. Then today, for another reason, we brought the system down and back up again. At that time, a "login:" prompt appeared on the printer, and no print jobs would print out. The printer is connected to port #7, which translates (according to doing an ls -l dev/tty*) to tty09. I had set the tty09 line in etc/ttys to "19tty09", which means, according to our documentation, "on-line, 1200 bps" for tty09. I could do an "echo test > dev/tty09" and see "test" print out on the printer. I hadn't figured out what "tty01" was connected to, and I had set it at "1itty01" (on-line, 19,200bps), which is the same as the ordinary terminal settings. I think this was my problem. We finally looked at a different system and saw that the etc/ttys file had 01 set to "07tty01". Also, instead of being set to "on-line", their printer port was set to "09tty09". We changed ours the same way, brought the system down and back up, and now could print OK. So we know how to get it to work; we don't know why what we did fixed it. I guess my questions are: 1) Since the printer worked OK AFTER I messed up etc/ttys and before we took the system down, but not afterwards, does this mean that etc/ttys is only looked at when the system comes up? This doesn't seem to agree with the behavior of using etc/ttys to bring a terminal online or take it off, which is done without affecting the rest of the system. 2) Is tty01 the "real" printer line, to which the software writes and then this is somehow translated to the line the printer device is physically connected to (in this case tty09)? If so, what makes the tty01 > tty09 connection? It looks like we could have plugged the printer into any port; somehow we have to tell the system which it is, but I haven't found out how that is done. 3) Does the physical printer tty line have to be shown in etc/ttys as "offline", as in our "09tty09", and then some background software overrides this to make it really online? 4) Where is this stuff described? The UNIX manual talks about lpr and various related commands, but nothing about the initial setup of the hardware configuration, and the software commands to implement it. (There is no "man" database on this system, by the way, so I couldn't get info there.) 5) What does the "7" in "07tty01" mean? (We have limited documentation that only mentions "9", "d", and "i" in that field.) Thanks for wading through all this... Regards, Will Martin PS - Please send any replies to BOTH "WMARTIN@OFFICE-3" and "WMARTIN@SIMTEL20". Usenet people can send to brl-bmd!wmartin.
lwa%mit-csr@sri-unix.UUCP (12/10/83)
The problem here lies in your supplier's use of the term 'on-line'. The first character of each line in the /etc/ttys file actually indicates whether that terminal line is to be available for login. Thus for each line in the /etc/ttys file which begins with '1', a program (/etc/getty, as I recall) is started at bootstrap time; this program prints out the "login:" message on the terminal and proceeds to wait for some user to type his login id. If the line in the /etc/ttys file begins with '0', the /etc/getty program is not run on that line. Printer ports, or ports used for communication with other computers, etc. should have the first character '0'. The second character is interpreted in a non-standardized way by /etc/getty to determine the characteristics of the terminal line: its terminal type, baud rate, number of stop bits, and so forth. There is no standard assignment of characters to terminal characteristics; in fact, most systems that I've seen don't even have documentation on the local meanings. This is one of the most poorly documented areas in UNIX. Probably the only way to find out what the particular characters in your /etc/ttys file mean is to look at the source of /etc/getty (or ask your supplier). Now the /etc/ttys file is normally only read at system startup, by the /etc/init program. This means that changes to the /etc/ttys file will normally only take effect after rebooting the system. Some versions of UNIX, however, permit reinitialization of the terminals without the need to reboot; this is performed by sending a SIGHUP signal to the /etc/init program, by using the command 'kill -1 1'. Unfortunately, this doesn't work on all versions of UNIX. It's not really that important, though, as on most systems the terminal configuration doesn't change all that often. Some of this stuff should be documented in section 5 of the UNIX manual; this is the section which describes file formats. Try looking for ttys(5) in the manual. Another possibility is that your manual may have a page for /etc/getty; this will probably be in getty(8). -Larry Allen -------