1

Running ubuntu server, I've reconfigured /lib/systemd/system/[email protected] to

[Service]
# the VT is cleared by TTYVTDisallocate
#                       ##ADDED THIS HERE##
ExecStart=-/sbin/agetty -a diagnosticuser --noclear %I $TERM
Type=idle
Restart=always
RestartSec=0
UtmpIdentifier=%I
TTYPath=/dev/%I
TTYReset=yes
TTYVHangup=yes
TTYVTDisallocate=yes
KillMode=process
IgnoreSIGPIPE=no
SendSIGHUP=yes

so that I could have my fancy little device automatically log in to a user whose shell is a diagnostic menu. The problem is that all the consoles automatically log in to that user now.

Is there a way to get just the first one to log in, and leave the rest with a regular log-in prompt? (can I have my cake as well as eat it?)

I was thinking, maybe I'd replace the "/sbin/agetty" with something that checks whether or not the "diagnosticuser" is already logged in. But I was a little confused by the hyphen in "-/sbin/agetty" and I didn't want to take my chances.

1 Answer 1

1

Create a new file for terminal 1 '/lib/systemd/system/[email protected]' and copy into it the config you defined above.

In /lib/systemd/system/[email protected] use the following:

ExecStart=-/sbin/agetty --noclear %I $TERM

Console 1 will autologin as diagnosticuser all other consoles will prompt for credentials.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.