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

classic Classic list List threaded Threaded
56 messages Options
123
Reply | Threaded
Open this post in threaded view
|

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

Gene Heskett-4
Greetings all;

This machine has only one serial port, which I normally use a session of  
minicom to connect as a terminal quit a bit dumber than a vt102, to a
TRS-80 Color Computer 3 in the basement. But my normal config for
minicom is /dev/ttyS0, but it claims the device is taken.

Sure enough, an lsof|grep ttyS0 shows an agetty attached to it.  And a
killall agetty as root only changes its pid until I've done the killall
as rapidly as I can uparrow and repeat it 6 or 7 times.

grepping thru  /etc does not seem to find any hits, so I've no clue whats
starting it.  So next I will do a search thru synaptic and remove it if
it will let me, or somehow disable it forever.

And the search for agetty in synaptic is also empty.
But as root, a locate agetty hits paydirt.

root@coyote:~$ locate agetty
/sbin/agetty
/usr/share/doc/util-linux/modems-with-agetty.txt
/usr/share/man/man8/agetty.8.gz

And the man 8 agetty page seems to indicate its a serial connection, I've
heard of as being available for troubleshooting even if its not fully
booted. Great, except I'm not sure I could go to the coco's keyboard and
run supercomm to see into linux, never tried it. In any event, the coco
is expecting a cr, and will respond by launching a shell bound to that
serial port on its end of the cable.

So what I'd like for it to do, is be totally silent during the rest of
this machines boot, and once a user, me, is logged in, go away just as
silently, freeing the only serial hardware port for my own use.

Next problem with minicom running as me is that it has no permissions to
save as its .dfl, the options it needs to Just Work as opposed to
messing around in its config screens finding a group of setting that
will work with the shells available on the coco, which of course is not
running its native rsdos, but a unix like system called nitros9 these
days.  Its os9 plus a few shots of unix testosterone.
 
What do I do next to get rid of this nearly invisible agetty gizmo once
this machine is booted?  It might be handy if this machine is truly
hung, but I can count those instances on one hand with fingers left over
in the 21 years I have been a linux only house.

Thanks all;

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 | Threaded
Open this post in threaded view
|

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

Miles Fidelman-3
agetty is "alternatative getty" - it's the terminal driver that listens
on each terminal port

it's launched by init (or systemd), most likely in respawn mode - you'll
need to find the init file (or systemd equivalent) that launches it, and
change the config

do a "man getty" or "man agetty" and you should find what you need

Miles Fidelman

On 6/5/19 10:04 PM, Gene Heskett wrote:

> Greetings all;
>
> This machine has only one serial port, which I normally use a session of
> minicom to connect as a terminal quit a bit dumber than a vt102, to a
> TRS-80 Color Computer 3 in the basement. But my normal config for
> minicom is /dev/ttyS0, but it claims the device is taken.
>
> Sure enough, an lsof|grep ttyS0 shows an agetty attached to it.  And a
> killall agetty as root only changes its pid until I've done the killall
> as rapidly as I can uparrow and repeat it 6 or 7 times.
>
> grepping thru  /etc does not seem to find any hits, so I've no clue whats
> starting it.  So next I will do a search thru synaptic and remove it if
> it will let me, or somehow disable it forever.
>
> And the search for agetty in synaptic is also empty.
> But as root, a locate agetty hits paydirt.
>
> root@coyote:~$ locate agetty
> /sbin/agetty
> /usr/share/doc/util-linux/modems-with-agetty.txt
> /usr/share/man/man8/agetty.8.gz
>
> And the man 8 agetty page seems to indicate its a serial connection, I've
> heard of as being available for troubleshooting even if its not fully
> booted. Great, except I'm not sure I could go to the coco's keyboard and
> run supercomm to see into linux, never tried it. In any event, the coco
> is expecting a cr, and will respond by launching a shell bound to that
> serial port on its end of the cable.
>
> So what I'd like for it to do, is be totally silent during the rest of
> this machines boot, and once a user, me, is logged in, go away just as
> silently, freeing the only serial hardware port for my own use.
>
> Next problem with minicom running as me is that it has no permissions to
> save as its .dfl, the options it needs to Just Work as opposed to
> messing around in its config screens finding a group of setting that
> will work with the shells available on the coco, which of course is not
> running its native rsdos, but a unix like system called nitros9 these
> days.  Its os9 plus a few shots of unix testosterone.
>    
> What do I do next to get rid of this nearly invisible agetty gizmo once
> this machine is booted?  It might be handy if this machine is truly
> hung, but I can count those instances on one hand with fingers left over
> in the 21 years I have been a linux only house.
>
> Thanks all;
>
> Cheers, Gene Heskett

--
In theory, there is no difference between theory and practice.
In practice, there is.  .... Yogi Berra

Theory is when you know everything but nothing works.
Practice is when everything works but no one knows why.
In our lab, theory and practice are combined:
nothing works and no one knows why.  ... unknown

Reply | Threaded
Open this post in threaded view
|

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

Felix Miata-3
In reply to this post by Gene Heskett-4
Gene Heskett composed on 2019-06-05 22:04 (UTC-0400):

> root@coyote:~$ locate agetty
> /sbin/agetty
Maybe this will be a useful clue:

In Stretch, any gettys running on vtty[1-6] are actually agettys.
Files in /etc/systemd/system/getty.target.wants/ are symlinks to:
        /lib/systemd/system/getty@service
# ps -A | grep get
 1021 tty3     00:00:00 agetty
 1022 tty4     00:00:00 agetty
 1023 tty2     00:00:00 agetty
 1451 tty1     00:00:00 agetty
 3932 tty6     00:00:00 agetty
12733 tty5     00:00:00 agetty

Why all this would tie up the serial port I don't know.
--
Evolution as taught in public schools is religion, not science.

 Team OS/2 ** Reg. Linux User #211409 ** a11y rocks!

Felix Miata  ***  http://fm.no-ip.com/

Reply | Threaded
Open this post in threaded view
|

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

David Wright-3
On Wed 05 Jun 2019 at 22:43:53 (-0400), Felix Miata wrote:

> Gene Heskett composed on 2019-06-05 22:04 (UTC-0400):
>
> > root@coyote:~$ locate agetty
> > /sbin/agetty
> Maybe this will be a useful clue:
>
> In Stretch, any gettys running on vtty[1-6] are actually agettys.
> Files in /etc/systemd/system/getty.target.wants/ are symlinks to:
> /lib/systemd/system/getty@service
> # ps -A | grep get
>  1021 tty3     00:00:00 agetty
>  1022 tty4     00:00:00 agetty
>  1023 tty2     00:00:00 agetty
>  1451 tty1     00:00:00 agetty
>  3932 tty6     00:00:00 agetty
> 12733 tty5     00:00:00 agetty
>
> Why all this would tie up the serial port I don't know.

Perhaps it's Gene's braille terminal.

Cheers,
David.

Reply | Threaded
Open this post in threaded view
|

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

tomas@tuxteam.de
In reply to this post by Gene Heskett-4
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

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.

Cheers

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

-- t

signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

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

Gene Heskett-4
On Thursday 06 June 2019 03:22:02 am [hidden email] 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 | Threaded
Open this post in threaded view
|

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

Erik Christiansen
On 06.06.19 07:14, Gene Heskett wrote:
> >   # 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.

Er, Gene, does your /etc/inittab have either of those lines uncommented
to activate a getty on them? If so, just comment them again. If not, did
your upgrade land you in systemdix land, so the traditional way is gone.

> 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.

Nah, systemd replaces the traditional SysV init stuff, if you let it be
installed. Then you have to learn new ways.

Erik

--
manual, n.:
A unit of documentation. There are always three or more on a given item.
One is on the shelf; someone has the others.
The information you need is in the others.               - Ray Simard

Reply | Threaded
Open this post in threaded view
|

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

Gene Heskett-4
On Thursday 06 June 2019 07:39:02 am Erik Christiansen wrote:

> On 06.06.19 07:14, Gene Heskett wrote:
> > >   # 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.
>
> Er, Gene, does your /etc/inittab have either of those lines
> uncommented to activate a getty on them? If so, just comment them
> again. If not, did your upgrade land you in systemdix land, so the
> traditional way is gone.

Yup, and so is /etc/inittab, it doesn't exist.

> > 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.
>
> Nah, systemd replaces the traditional SysV init stuff, if you let it
> be installed. Then you have to learn new ways.

So its apparent. But I watched the D-Day stuff live, so I'm going to
catch up on the sleep I missed from 4 to 7 this morning.

Thanks  Erik


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 | Threaded
Open this post in threaded view
|

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

Greg Wooledge
In reply to this post by tomas@tuxteam.de
On Thu, Jun 06, 2019 at 09:22:02AM +0200, [hidden email] wrote:
> 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.

I'm pretty sure getty has always used exec() to replace itself with
login(1) or a login(1) equivalent.  There's no reason for it to sit
around holding memory.

> I don't know where /etc/inittab is under that newfangled
> init system, but I'm sure others will chime in.

There isn't one under systemd.

This might be a starting point:

========================================================================
wooledg:~$ grep -ri serial /lib/systemd/system
/lib/systemd/system/getty@.service:Documentation=http://0pointer.de/blog/projects/serial-console.html
/lib/systemd/system/getty@.service:# that serial gettys are covered by serial-getty@.service, not this
/lib/systemd/system/getty.target:Documentation=http://0pointer.de/blog/projects/serial-console.html
/lib/systemd/system/serial-getty@.service:Description=Serial Getty on %I
/lib/systemd/system/serial-getty@.service:Documentation=http://0pointer.de/blog/projects/serial-console.html
/lib/systemd/system/getty-pre.target:Documentation=http://0pointer.de/blog/projects/serial-console.html
/lib/systemd/system/wacom-inputattach@.service:Description=inputattach for Wacom ISDv4-compatible serial devices
/lib/systemd/system/wacom-inputattach@.service:ExecStart=/usr/bin/isdv4-serial-inputattach /dev/%I

wooledg:~$ cat /lib/systemd/system/serial-getty@.service
#  SPDX-License-Identifier: LGPL-2.1+
#
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

[Unit]
Description=Serial Getty on %I
Documentation=man:agetty(8) man:systemd-getty-generator(8)
Documentation=http://0pointer.de/blog/projects/serial-console.html
BindsTo=dev-%i.device
After=dev-%i.device systemd-user-sessions.service plymouth-quit-wait.service getty-pre.target
After=rc-local.service

# If additional gettys are spawned during boot then we should make
# sure that this is synchronized before getty.target, even though
# getty.target didn't actually pull it in.
Before=getty.target
IgnoreOnIsolate=yes

# IgnoreOnIsolate causes issues with sulogin, if someone isolates
# rescue.target or starts rescue.service from multi-user.target or
# graphical.target.
Conflicts=rescue.service
Before=rescue.service

[Service]
# The '-o' option value tells agetty to replace 'login' arguments with an
# option to preserve environment (-p), followed by '--' for safety, and then
# the entered username.
ExecStart=-/sbin/agetty -o '-p -- \\u' --keep-baud 115200,38400,9600 %I $TERM
Type=idle
Restart=always
UtmpIdentifier=%I
TTYPath=/dev/%I
TTYReset=yes
TTYVHangup=yes
KillMode=process
IgnoreSIGPIPE=no
SendSIGHUP=yes

[Install]
WantedBy=getty.target
========================================================================

Now, I'm definitely no systemd guru.  I do know that the @ sign in the
service name is magical -- it acts like a wildcard of some kind, meaning
this is a service that can have a bunch of instances running.

It points to <http://0pointer.de/blog/projects/serial-console.html> which
looks like it's definitely worth reading.  You'll want to digest that
before doing anything else.

Reply | Threaded
Open this post in threaded view
|

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

tomas@tuxteam.de
On Thu, Jun 06, 2019 at 08:26:12AM -0400, Greg Wooledge wrote:
> On Thu, Jun 06, 2019 at 09:22:02AM +0200, [hidden email] wrote:
> > 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.
>
> I'm pretty sure getty has always used exec() to replace itself with
> login(1) or a login(1) equivalent.  There's no reason for it to sit
> around holding memory.

Makes sense, yes.

Cheers
-- t

signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

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

bw-2
In reply to this post by Gene Heskett-4
In-Reply-To: <[hidden email]>
<snip>
>So what I'd like for it to do, is be totally silent during the rest of
>this machines boot, and once a user, me, is logged in, go away just as
>silently, freeing the only serial hardware port for my own use.
...

I think the first place I'd look is:

man logind.conf

there may be something there to help you figure it out.  Then look into
override if necessary with something like:

systemctl edit getty@.service

Reply | Threaded
Open this post in threaded view
|

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

Miles Fidelman-3
In reply to this post by tomas@tuxteam.de
One minor nit...

On 6/6/19 3:22 AM, [hidden email] wrote:
> 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.

No longer so young, and never handsome, but still connecting to our
servers via a terminal connection (SSH specifically).  Pretty common for
servers - why bother with popping an X-window or other GUI for sys admin
work.  Lots of getty instances running, sitting on network ports, just
waiting for logins.

Miles Fidelman

--
In theory, there is no difference between theory and practice.
In practice, there is.  .... Yogi Berra

Theory is when you know everything but nothing works.
Practice is when everything works but no one knows why.
In our lab, theory and practice are combined:
nothing works and no one knows why.  ... unknown

Reply | Threaded
Open this post in threaded view
|

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

Miles Fidelman-3
In reply to this post by David Wright-3
On 6/5/19 11:15 PM, David Wright wrote:

> On Wed 05 Jun 2019 at 22:43:53 (-0400), Felix Miata wrote:
>> Gene Heskett composed on 2019-06-05 22:04 (UTC-0400):
>>
>>> root@coyote:~$ locate agetty
>>> /sbin/agetty
>> Maybe this will be a useful clue:
>>
>> In Stretch, any gettys running on vtty[1-6] are actually agettys.
>> Files in /etc/systemd/system/getty.target.wants/ are symlinks to:
>> /lib/systemd/system/getty@service
>> # ps -A | grep get
>>   1021 tty3     00:00:00 agetty
>>   1022 tty4     00:00:00 agetty
>>   1023 tty2     00:00:00 agetty
>>   1451 tty1     00:00:00 agetty
>>   3932 tty6     00:00:00 agetty
>> 12733 tty5     00:00:00 agetty
>>
>> Why all this would tie up the serial port I don't know.

Depends on how the serial port is configured.  It's pretty standard for
it to be set up as a console, by default, in which case an instance of
getty would be running waiting for a user to login.

Miles Fidelman


Reply | Threaded
Open this post in threaded view
|

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

Gene Heskett-4
In reply to this post by tomas@tuxteam.de
On Thursday 06 June 2019 08:32:02 am [hidden email] wrote:

> On Thu, Jun 06, 2019 at 08:26:12AM -0400, Greg Wooledge wrote:
> > On Thu, Jun 06, 2019 at 09:22:02AM +0200, [hidden email] wrote:
> > > 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.
> >
> > I'm pretty sure getty has always used exec() to replace itself with
> > login(1) or a login(1) equivalent.  There's no reason for it to sit
> > around holding memory.
>
> Makes sense, yes.
>
Thanks Tomas

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 | Threaded
Open this post in threaded view
|

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

Gene Heskett-4
In reply to this post by bw-2
On Thursday 06 June 2019 08:37:36 am bw wrote:

> In-Reply-To: <[hidden email]>
> <snip>
>
> >So what I'd like for it to do, is be totally silent during the rest
> > of this machines boot, and once a user, me, is logged in, go away
> > just as silently, freeing the only serial hardware port for my own
> > use.
>
> ...
>
> I think the first place I'd look is:
>
> man logind.conf
>
> there may be something there to help you figure it out.  Then look
> into override if necessary with something like:
>
> systemctl edit getty@.service

Might be, but the dead keyboard hit it 30 minutes back so I rebooted and
now its normal.  I need a near beer.

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 | Threaded
Open this post in threaded view
|

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

bw-2
In reply to this post by Gene Heskett-4
In-Reply-To: <[hidden email]>

>On Thursday 06 June 2019 08:37:36 am bw wrote:
>>
>> In-Reply-To: <[????] [hidden email]>
>> <snip>
>>
>> >So what I'd like for it to do, is be totally silent during the rest
>> > of this machines boot, and once a user, me, is logged in, go away
>> > just as silently, freeing the only serial hardware port for my own
>> > use.
>>
>> ...
>>
>> I think the first place I'd look is:
>>
>> man logind.conf
>>
>> there may be something there to help you figure it out.  Then look
>> into override if necessary with something like:
>>
>> systemctl edit getty@.service
>
>Might be, but the dead keyboard hit it 30 minutes back so I rebooted and
>now its normal.  I need a near beer.
>
>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>
You have a definite style Gene, and a tenaciousness that I really admire.  
I'm assuming after all this time you are doing some work and have a
functioning system going, congratulations.

For future reference, you can prevent any systemd service from starting by
putting a link to /dev/null in /etc/systemd/system AFAIK that is exactly
what 'systemctl mask' does, but the benefit from using systemctl is it
also checks your spelling.

I don't think all the 6 getty@ services are started at boot like with
inittab, the particualt getty appears after the VT is activated.  You can
mask one or override it as you want with systemctl edit getty@ttyWHATEVER
and this is pretty cool.  You could setup things to do whatever when any
particular VT is activated.

good luck
bw
Reply | Threaded
Open this post in threaded view
|

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

Gene Heskett-4
On Thursday 06 June 2019 05:55:36 pm bw wrote:

> In-Reply-To: <[hidden email]>
>
> >On Thursday 06 June 2019 08:37:36 am bw wrote:
> >> In-Reply-To: <[????] [hidden email]>
> >> <snip>
> >>
> >> >So what I'd like for it to do, is be totally silent during the
> >> > rest of this machines boot, and once a user, me, is logged in, go
> >> > away just as silently, freeing the only serial hardware port for
> >> > my own use.
> >>
> >> ...
> >>
> >> I think the first place I'd look is:
> >>
> >> man logind.conf
> >>
Nothing of use there.

> >> there may be something there to help you figure it out.  Then look
> >> into override if necessary with something like:
> >>
> >> systemctl edit getty@.service
> >
> >Might be, but the dead keyboard hit it 30 minutes back so I rebooted
> > and now its normal.  I need a near beer.
> >
> >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>
>
> You have a definite style Gene, and a tenaciousness that I really
> admire. I'm assuming after all this time you are doing some work and
> have a functioning system going, congratulations.
>
Like Sam Clemens, I have never let my education get in the way of my
learning. But  my education is 8th grade, I went to work in the late
40's fixing radio and tv's for a living, before that I wired a house my
stepfather built right after the end of WW-II. I was 12 at the time.  I
was a nerd before the word was invented.  That scared the girls off so I
was late finding one that wanted to sleep on the bottom. Good woman but
I lost her to a stroke 10 years later.  So life's had its ups and downs.

I finished up my working time at 67, the last 18 years at the local CBS
affiliate, as the Chief and often only engineer, one who had a
reputation for fixing things. Along the line I picked up an fcc 1st
phone, and I'm also a C.E.T.  Sat for the mensa, but failed, this was
about 6 months after I had a pulmonary embolism which hurt my brain some
I think. Survival rates from those are well under 10%.  He's had several
opportunities, but I don't think he wants to deal with me just yet. :)
That got me 4F'd during Korea, they had no use for anyone who scored a 98
on the AFQT. They were looking for machine gun targets I guess.  The
next best score out of 130 some other boys was 36.
 

> For future reference, you can prevent any systemd service from
> starting by putting a link to /dev/null in /etc/systemd/system AFAIK
> that is exactly what 'systemctl mask' does, but the benefit from using
> systemctl is it also checks your spelling.
>
> I don't think all the 6 getty@ services are started at boot like with
> inittab, the particualt getty appears after the VT is activated.  You
> can mask one or override it as you want with systemctl edit
> getty@ttyWHATEVER and this is pretty cool.  You could setup things to
> do whatever when any particular VT is activated.
>
> good luck
> bw

Not getting anyplace so far, but the reboot has given me only one agetty
running on tty1, which looks like exactly
what /etc/systemd/system/getty.target.wants/[hidden email]
wants.  It also says as a comment:

# On systems without virtual consoles, don't start any getty. Note
# that serial gettys are covered by serial-getty@.service, not this
# unit.

root@coyote:getty.target.wants$ locate serial-getty@.service
/lib/systemd/system/serial-getty@.service

But wouldn't a link to that have to exist in this /etc/systemd tree?

But no serial-getty@.service exists in this tree, but it does exist as
/lib/systemd/system/serial-getty@.service

So what sort of a precondition that didn't happen on this reboot, would
trigger this above file to grab and lockup /dev/ttyS0 like it did on the
last reboot.

I am beginning to get a very dim glimmer of how systemd works.  And its
not impressing me.

Thanks bw, you gave me some usefull clues.  Take care.

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 | Threaded
Open this post in threaded view
|

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

Jonathan Dowland
On Fri, Jun 07, 2019 at 01:23:45AM -0400, Gene Heskett wrote:
>Not getting anyplace so far, but the reboot has given me only one agetty
>running on tty1, which looks like exactly
>what /etc/systemd/system/getty.target.wants/[hidden email]
>wants.  It also says as a comment:

I don't think getty.target is relevant to you unless you are asking systemd to
set your system up to that target: the default target is graphical.target, and
the other one you are likely to use is multi-user.target. If you haven't
knowingly changed your system's default target, it will be graphical.target.

If you don't know what a systemd target is, then you likely haven't changed
your system to use one other than the default. (You can learn more about systemd
targets in the manpage systemd.target. They're vaguely analogous to sysvinit
runlevels).

>root@coyote:getty.target.wants$ locate serial-getty@.service
>/lib/systemd/system/serial-getty@.service

That's the "serial getty generator service". It's not a concrete service per
se, more a template from which concrete services will derive. A concrete
example would be [hidden email]. On my system:

> ▶ systemctl status [hidden email]
> ● [hidden email] - Serial Getty on ttyS0
>    Loaded: loaded (/lib/systemd/system/serial-getty@.service; disabled; vendor preset: enabled)
>    Active: inactive (dead)
>      Docs: man:agetty(8)
>            man:systemd-getty-generator(8)
>            http://0pointer.de/blog/projects/serial-console.html

So my system has a service defined for a getty on ttyS0 but it is both
disabled and not running. What I would have suggested to you, if you still
had your machine in the state where the getty was running, would be to
try "systemctl status [hidden email]" and see what the result
was. If it were running, "systemctl stop [hidden email]" would
stop it, and "systemctl disable [hidden email]" would disable
it from starting automatically again (if it were configured to do so).

>But wouldn't a link to that have to exist in this /etc/systemd tree?

No. Systemd reads the contents of /lib/systemd and /etc/systemd; the latter
overrides the former, if it specifies units with the same name. This is so
that the package manager can freely update and overwrite units supplied in
packages (to /lib/systemd), without interfering with any manual configuration
that you have performed as a user (in /etc/systemd).

>So what sort of a precondition that didn't happen on this reboot, would
>trigger this above file to grab and lockup /dev/ttyS0 like it did on the
>last reboot.

If you caused a service to be started that expressed a dependency upon
[hidden email] (or [hidden email], that's also possible
although unlikely and not useful) then that would be one explanation. I am not
aware of any such service, and cannot find one on my system at least.

>I am beginning to get a very dim glimmer of how systemd works.  And its
>not impressing me.

You are free to switch back to sysvinit if you wish. To do so you need to
install sysvinit-core (and remove systemd-sysv, which will likely be removed
by the action of installing sysvinit-core). This will change your init system
to sysvinit, although it would not remove all of systemd, and some parts of
it are likely depended upon by other stuff on your system.


--

⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Jonathan Dowland
⢿⡄⠘⠷⠚⠋⠀ https://jmtd.net
⠈⠳⣄⠀⠀⠀⠀ Please do not CC me, I am subscribed to the list.

Reply | Threaded
Open this post in threaded view
|

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

Gene Heskett-4
On Friday 07 June 2019 06:24:00 am Jonathan Dowland wrote:

> On Fri, Jun 07, 2019 at 01:23:45AM -0400, Gene Heskett wrote:
> >Not getting anyplace so far, but the reboot has given me only one
> > agetty running on tty1, which looks like exactly
> >what /etc/systemd/system/getty.target.wants/[hidden email]
> >wants.  It also says as a comment:
>
> I don't think getty.target is relevant to you unless you are asking
> systemd to set your system up to that target: the default target is
> graphical.target, and the other one you are likely to use is
> multi-user.target. If you haven't knowingly changed your system's
> default target, it will be graphical.target.
>
> If you don't know what a systemd target is, then you likely haven't
> changed your system to use one other than the default. (You can learn
> more about systemd targets in the manpage systemd.target. They're
> vaguely analogous to sysvinit runlevels).
>
> >root@coyote:getty.target.wants$ locate serial-getty@.service
> >/lib/systemd/system/serial-getty@.service
>
> That's the "serial getty generator service". It's not a concrete
> service per se, more a template from which concrete services will
> derive. A concrete
>
> example would be [hidden email]. On my system:
> > ▶ systemctl status [hidden email]
> > ● [hidden email] - Serial Getty on ttyS0
> >    Loaded: loaded (/lib/systemd/system/serial-getty@.service;
> > disabled; vendor preset: enabled) Active: inactive (dead)
> >      Docs: man:agetty(8)
> >            man:systemd-getty-generator(8)
> >            http://0pointer.de/blog/projects/serial-console.html
>
> So my system has a service defined for a getty on ttyS0 but it is both
> disabled and not running. What I would have suggested to you, if you
> still had your machine in the state where the getty was running, would
> be to try "systemctl status [hidden email]" and see what
> the result was. If it were running, "systemctl stop
> [hidden email]" would stop it, and "systemctl disable
> [hidden email]" would disable it from starting
> automatically again (if it were configured to do so).
>
> >But wouldn't a link to that have to exist in this /etc/systemd tree?
>
> No. Systemd reads the contents of /lib/systemd and /etc/systemd; the
> latter overrides the former, if it specifies units with the same name.
> This is so that the package manager can freely update and overwrite
> units supplied in packages (to /lib/systemd), without interfering with
> any manual configuration that you have performed as a user (in
> /etc/systemd).
>
> >So what sort of a precondition that didn't happen on this reboot,
> > would trigger this above file to grab and lockup /dev/ttyS0 like it
> > did on the last reboot.
>
> If you caused a service to be started that expressed a dependency upon
> [hidden email] (or [hidden email], that's also
> possible although unlikely and not useful) then that would be one
> explanation. I am not aware of any such service, and cannot find one
> on my system at least.
>
Neither can I and this "service" is not a familiar term since this is my
first expedition into systemd territory.

And its and intermittent only service. I am the author of several handy
utilities for that old Unix-like os on a box with a 16 bit address buss,
and there are still a good 1000 users of it on this ball of rock &
water. 2 services actually, one is called drivewire, and makes use if
the machines bit banger port at 115kbaud, and this terminal function
that minicom is doing against a hardware serial port on that machine. 2
independent services.

Drivewire was written in Java, and changes in Java from wheezy to stretch
have killed that, but a replacement is being written in python in hopes
it might be a more stable language. We as a group, had no clue that Java
would be changed to be so damned incompatible with itself. So I'm
playing canary in a coal mine testing the python version. For a machine
that was new in the early 80's, I am amazed at the new blood it has
attracted in the last 2 or 3 years. Mailing list sub count has nearly
doubled in the last 4 years.  And with that new blood has come quite a
list of of newly designed hardware accessories for it.  Sure, its being
built on kitchen tables in runs of 10 or 20, but its happening 35 years
later. That in itself is amazing. And redefines the word retro. I can
recall the days when vacuum tubes were state of the art, and knowing how
they work has given me a nice lengthy ladder up the side of that famous
hog. A rather broad knowledge of physics hasn't hurt a thing either,
including Einsteins work.

> >I am beginning to get a very dim glimmer of how systemd works.  And
> > its not impressing me.
>
> You are free to switch back to sysvinit if you wish. To do so you need
> to install sysvinit-core (and remove systemd-sysv, which will likely
> be removed by the action of installing sysvinit-core). This will
> change your init system to sysvinit, although it would not remove all
> of systemd, and some parts of it are likely depended upon by other
> stuff on your system.

I can likely go with the flow as long as its documented in readily
accessable form, something that L.P. is good at, he writes nice "papers"
on his stuff but hides that info from the unwashed by not putting out
decent man-pages. I disagree loudly about that but the exclusion of
examples from manpages seems like an insidious attack on the users
intelligence. I give you the present state of the docs for ip as an
example of how NOT to do a man page. 300 lines of "options" without a
word on which is required to get or apply what data or what if any
interactions there may be. I have yet to get a path condition report out
of it like ifconfig gives by default. That is not progress unless you
are using GE's definition from the late '50's.

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 | Threaded
Open this post in threaded view
|

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

Michael Stone-2
In reply to this post by Gene Heskett-4
On Wed, Jun 05, 2019 at 10:04:09PM -0400, Gene Heskett wrote:
>grepping thru  /etc does not seem to find any hits, so I've no clue whats
>starting it.

Did you happen to tell the kernel that ttyS0 was a console? (cat
/proc/cmdline)


123