Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

In the old days I just modified /etc/inittab. Now, with systemd, it seems to start tty[1-6] automatically, how should I disable tty[4-6]?

Looks like there's only one systemd service file, and it use a %I to discern different tty sessions. I hope I don't need to remove that service, and create each getty@ttyX.service manually.

share|improve this question

1 Answer 1

up vote 13 down vote accepted

There is no real need to disable "extra" TTYs as under systemd gettys are generated on demand: see man systemd-getty-generator for details. Note that, by default, this automatic spawning is done for the VTs up to VT6 only (to mimic traditonal Linux systems).

As Lennart says in a blog post1:

In order to make things more efficient login prompts are now started on demand only. As you switch to the VTs the getty service is instantiated to getty@tty2.service, getty@tty5.service and so on. Since we don't have to unconditionally start the getty processes anymore this allows us to save a bit of resources, and makes start-up a bit faster.

If you do wish to configure a specific number of gettys, you can, just modify logind.conf with the appropriate entry, in this example 3:

NAutoVTs=3


1. In fact the entire series of posts—currently numbering 18— systemd for Administrators, is well worth reading.

share|improve this answer
    
Thanks for the answer, Jason. My company's application is shipped on a physical server and on older distributions we would modify inittab to lock out other ttys. –  jacobwalker0814 Oct 23 '13 at 23:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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