1

I have a Stretch system n which I would like to replace agetty with ngetty (for various reasons like because I have no use for serial lines, and I like the way ngetty can be configured, for examples).

I know how to do that in runit or sysvinit, but I can't find where the info is with systemd.

I can find nothing which seems related in /etc (the inittab file is simply not used for the related lines) but there seems to have related files in /lib/systemd/system/.

I must admit I do not feel comfortable to hack things in this folder, so what would be the cleanest way to do that in Debian?

Thanks.

Rui F Ribeiro
  • 56,709
  • 26
  • 150
  • 232
  • Please use paragraphs; the question is harder to read without them. – Rui F Ribeiro Aug 15 '17 at 16:58
  • I did insert spaces and newlines while writting, but it seems they went in /dev/null. How can I fix that? – user3459474 Aug 15 '17 at 17:19
  • It is your browser? Odd, nothing out of ordinary here. – Rui F Ribeiro Aug 15 '17 at 17:29
  • Maybe, I am using safari on an iphone, but this never happened on other websites... Could it be related to the mobile site version of SO? – user3459474 Aug 15 '17 at 17:52
  • Use the app instead. – Rui F Ribeiro Aug 15 '17 at 17:55
  • Sorry, but I don't really want to give my bank onfo to apple. I only use this thing becausecit was a gift, and I do not want to buy a "smart"phone when I have one functionnal, even I don't trust it :) – user3459474 Aug 15 '17 at 18:03
  • 1
    A related question is https://unix.stackexchange.com/questions/247293/ , but ngetty is not a drop-in replacement for agetty. It is invoked differently, and it has its own service management. To make actual use of that, one wouldn't do things as per that question and the answer here would be somewhat different. Also note that ngetty's on-demand TTY login service invocation fights with systemd-logind's on-demand TTY login service invocation. – JdeBP Aug 16 '17 at 11:33
  • I know that ngetty is different than agetty, otherwise I wouldn't wan't to change. – user3459474 Aug 21 '17 at 20:45
  • I know that ngetty is different than agetty, otherwise I wouldn't wan't to change. It's a daemon that pops instances on demand, like many other ones: if I am not wrong, apache can do the same. And in practice, on Debian there are many agetty instances for nothing, so management is not done properly somewhere: systemd or maintainers, not impotant. Agetty also does too much things (rs232) while not allowing things ngetty does (better config). About systemd fight against ngetty: ngetty is a daemon specialized in ttys management like apache is spec in http connections. I don't see the problem? – user3459474 Aug 21 '17 at 21:11

1 Answers1

1

Seems like you may be on a virtual environment where getty is useless. You may switch to mingetty (default at Amazon AWS now), which uses minimal resources and still be able to look at the "Console Logs" (via Amazon vm GUI ..eeeek).

To switch from agetty to ngetty or mingetty, (you just need one):

# apt install mgetty
# apt install mingetty

To tell debian to start using you new getty, update your /sbin/getty symbolic-link to (pick one):

# cd /sbin
# rm getty
# ln -s mgetty getty
# ln -s mingetty getty

BONUS: If in a cloud based environment, you really don't care about multiple consoles, you may even reduce the # of consoles to just 1 (for viewing console logs on Amazon CLI). To do this:

Edit /etc/default/console-setup and replace:

ACTIVE_CONSOLES=/dev/tty[1-6]
with...
ACTIVE_CONSOLES=/dev/tty[1-1]

Cheers...

  • I guess I'll accept this, despite the fact that it's not really clean and that updates could break it. On the other hand, the fix to avoid the breakage seems to be easy on debian: dpkg-divert --add /sbin/getty should do the trick. – user3459474 Dec 12 '17 at 10:17