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.

  • 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
  • 1
    A related question is 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
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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.