lmc@denelcor.UUCP (Lyle McElhaney) (01/29/84)
Can some kindly soul tell me what I can put in an inittab (USG Unix, now) entry to set the baud rate and other port characteristics, but not leave getty hanging around on that port? I've tried various combinations of stty and so on, but nothing reliably serts the characteristics but getty, whichI have to (sometimes) later blow away. I can, of course, hack the getty source into something to do this and then exit, but I think that there must be something available (ain't there?). Thanks for your help. -- Lyle McElhaney (hao,brl-bmd,nbires,csu-cs,scgvaxd)!denelcor!lmc
sdyer@bbncca.ARPA (Steve Dyer) (01/30/84)
Speaking of inittab entries, what run-level is recommended (or at least adopted as standard) for "/etc/getty" processes during multi-user mode? The sample "inittab" supplied with the VAX System V 1.0 tape gives no clue. 1? 6? Thanks, -- /Steve Dyer decvax!bbncca!sdyer sdyer@bbncca
chris@umcp-cs.UUCP (01/31/84)
Without a program 'hanging onto' a port the settings are pretty much useless, at least in V7 and 4BSD. A tty that is not attached to a process gets reset when you open it to a (probably site-dependent) default. The only way to get it to go some way and stay that way is to open it and hold onto it, then set the modes. A "standard trick" is to use sleep 1000000 > /dev/ttyXX & before setting things up. (Then you have to go kill the sleep later, usually.) -- In-Real-Life: Chris Torek, Univ of MD Comp Sci UUCP: {seismo,allegra,brl-bmd}!umcp-cs!chris CSNet: chris@umcp-cs ARPA: chris.umcp-cs@CSNet-Relay
bjb@whuxle.UUCP (01/31/84)
#R:denelcor:-28700:whuxle:25800001:000:377 whuxle!bjb Jan 30 20:56:00 1984 re: having a getty set a baud rate and exit.. What you're asking for probably won't work. As soon as the getty terminates and the file descriptor (for the tty) is closed, the baud rate will be lost. If you want to do something like a "poor persons" line printer driver, something like the following may work... ( stty 9600; cat $file ) < /dev/ttyxx > /dev/ttyxx B. Beare
mse@ih1ap.UUCP (Scott Erickson) (01/31/84)
Run level 2 is normally used for multi-user mode. Scott Erickson ihnp4!ih1ap!mse
geoff@proper.UUCP (Geoff Kuenning) (02/07/84)
The general problem of making stty settings last past a close is insoluble in standard Unix because the TTY drivers set up the default terminal characteristics on the first open. This seems undesirable to me because many people want to set up serial printers, etc. In the Unix System V shipped by Callan Data Systems (my employer), I have take the liberty of solving this by making the following nonstandard kernel modification: When a TTY is closed, the baud rate and terminal characteristics are not modified unless "hangup-on-close" (stty "hupcl" option) is set, in which case the baud rate is set to zero. When a TTY is opened, the terminal characteristics and baud rate are initialized *ONLY* if the baud rate was previously zero. This allows TTY settings to be preserved by the simple expedient of including "-hupcl" in the stty command. If you want TTY settings to default to the system standard, you simply set "hupcl". Simple and, as far as I can tell, non-dangerous.
dan@rna.UUCP (02/09/84)
I'm sure your kernel mods to keep TTY settings after a close work
fine, but what's wrong with:
pause:
main()
{
pause();
}
and in /etc/rc:
pause > /dev/lpr &
If you have many printers, write the trivial program to open them all
up and then pause(). You can even do the kludge of opening /tmp and /bin to
keep their inodes in core.
Whatever,
Dan Ts'o
...cmcl2!rna!dan
rpw3@fortune.UUCP (02/11/84)
#R:denelcor:-28700:fortune:26900024:000:575 fortune!rpw3 Feb 11 00:32:00 1984 At Fortune we went a little further than Geoff at Callan. We bit the bullet and add an IOCTL for copying the current modes to the default (after close) modes, so you can say "stty 1200 savemodes >/dev/tty05", for example. Modes are copied from the defaults on each "first open", so 'hupcls' doesn't wipe the default speed. This makes non-login ports (printers, comm lines) VERY much easier to deal with. Rob Warnock UUCP: {sri-unix,amd70,hpda,harpo,ihnp4,allegra}!fortune!rpw3 DDD: (415)595-8444 USPS: Fortune Systems Corp, 101 Twin Dolphins Drive, Redwood City, CA 94065