ungetty
Lance Ellinghouse
root at chief.UUCP
Fri Dec 16 06:32:55 AEST 1988
In article <660 at vector.UUCP>, chip at vector.UUCP (Chip Rosenthal) writes:
> In article <6 at rsoft.UUCP> frank at 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 at 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 at ee.UCLA.EDU
More information about the Comp.unix.wizards
mailing list