Xref: utzoo comp.unix.xenix:4219 comp.unix.wizards:13570 Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!elroy!gryphon!cadovax!ucla-an!remsit!chief!root From: root@chief.UUCP (Lance Ellinghouse) Newsgroups: comp.unix.xenix,comp.unix.wizards Subject: Re: ungetty Summary: ungetty Keywords: ungetty getty init Message-ID: <460@chief.UUCP> Date: 15 Dec 88 20:32:55 GMT References: <6@rsoft.UUCP> <660@vector.UUCP> Organization: Chief Numismatics Inc., Woodland Hills, Ca 91364 Lines: 37 In article <660@vector.UUCP>, chip@vector.UUCP (Chip Rosenthal) writes: > In article <6@rsoft.UUCP> frank@rsoft.UUCP (Frank I. Reiter) writes: > >Can anybody tell me how ungetty interacts with getty or point me at a good > >source of information? > > As far as I know, the interface is undocumented. But, I believe signals > SIGUSR1 and SIGUSR2 are used to communicate between /usr/lib/uucp/ungetty > and /etc/getty. Reading between the lines, when you call ungetty with a > tty device, it looks in /etc/utmp for the PID of the getty on that line, > and then does a kill() to signal the getty to either suspend or resume. > Note that ungetty is a setuid program, which is required for the kill() > to work. > -- > Chip Rosenthal chip@vector.UUCP | Choke me in the shallow water > Dallas Semiconductor 214-450-5337 | before I get too deep. ungetty signals getty with a SIGUSR1 to halt the getty. The getty then closes all it's files so that they will not interfere with any other program that wants to use the line. It then does a pause(), and this suspends the activity untill it gets another signal. when you want to use the line again, you call ungetty with a -r argument. ungetty then sends a SIGUSR1 again, thus waking up getty. It then ends and init spawns another getty. This is what I could figure out by playing around a little. if you want to suspend getty for any reason, all you have to do it send a SIGUSR1 to it and it will stop. Any program can do this. Just MAKE sure you send it another SIGUSR1, so that it can startup again. Otherwise you will NOT be able to spawn a new getty on that line! -- Lance Ellinghouse Chief Numismatics, Inc UUCP: ...!{hermix|srhqla|ucla-an|alphacm}!chief!lance ARPA: ucla-an!hermix!chief!lance@ee.UCLA.EDU