[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: What is agetty, and why can't it be stopped?



On Thursday 06 June 2019 03:22:02 am tomas@tuxteam.de wrote:

> On Wed, Jun 05, 2019 at 10:04:09PM -0400, Gene Heskett wrote:
>
> [agetty]
>
> People have given very useful answers, so I'll restrict myself
> to some history.
>
> Gene, you've been wasting your time with junk OSes, otherwise
> you'd know who "getty" is. Agetty is just an alternative
> implementation of that.
>
> Back then [TM], when we were young and handsome [1], a Unix
> box had several terminals connected to it. Typically users
> would show up at one of these terminals, perhaps hit ENTER,
> and be presented with some greeting -- something like "Login:",
> perhaps.
>
> Entering user name and password gave the user an interactive
> session, courtesy of a shell.
>
> The process responsible to start all of this was "getty",
> which just waited on a terminal until something happens,
> and then set off the whole authentication - session dance.
>
> Getty stayed the parent of that whole session "process
> tree", which at the end of the session folded nicely back.
> On termination of getty's child, getty itself terminated.
>
> To get the ball rolling again, getty's parent (typically
> init) started a new getty (in our jargon, "respawn"). You
> could configure that behaviour in a file called /etc/inittab.
>
> So, what you're seeing is not "agetty" "changing its PID",
> as you see (I don't think Unix allows that!), but a "new"
> instance of agetty being started. And you can kill as fast
> as you will -- I don't think you're going to out-kill init.
>
> I don't know where /etc/inittab is under that newfangled
> init system, but I'm sure others will chime in. On a
> recent (stretch) Debian with SysV, this file still exists,
> and you can see (this is just the relevant snippet):
>
>   # Note that on most Debian systems tty7 is used by the X Window
> System, # so if you want to add more getty's go ahead but skip tty7 if
> you run X. #
>   1:2345:respawn:/sbin/getty 38400 tty1
>   2:23:respawn:/sbin/getty 38400 tty2
>   3:23:respawn:/sbin/getty 38400 tty3
>   4:23:respawn:/sbin/getty 38400 tty4
>   5:23:respawn:/sbin/getty 38400 tty5
>   6:23:respawn:/sbin/getty 38400 tty6
>
>   # Example how to put a getty on a serial line (for a terminal)
>   #
>   #T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100
>   #T1:23:respawn:/sbin/getty -L ttyS1 9600 vt100
>
Yes, I recall those days. But until now ttyS0 and S1 if it existed, were 
free for my to use. Now it seems to want to grab everything in sight.

This is MY machine, and it should be able to do what I want it to do.  I 
finally did kill the one that was grabbing ttyS0. In fact it appears I 
killed them all, htop cannot find one running now, and neither can an 
lsof, Yet the machine seems to be running normally.

> Cf. man inittab for details. See? Still gettys being started
> here, for the Linux virtual consoles. And some examples on
> how to do it for serial terminals.
>
No man page for inittab seems to be installed.  That seems to be a head 
scratcher right there.

> Cheers
>
> [1] My memory is foggy, so I won't commit myself to remember
>    whether some dinosaurs roamed the world at that time.

Mines not the greatest after all these years either, but I don't think 
so, allthough we did have an honest democrat occasionally.  Definitely a 
conciderably more endangered specie today.

grepping thru /etc/systemd is also a puzzle, there seems to be only 1 
wanting ttyS1, which does not exist on this mobo. Nothing mentions 
ttyS0, so I still have not identified what starts it. So I'm going back 
to bed.

Thanks Tomas
> -- t


Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>


Reply to: