systemd / systemd

The systemd System and Service Manager
https://systemd.io
GNU General Public License v2.0
12.83k stars 3.69k forks source link

getty@ttyX.service is started if going to ctrl+alt+fX although is masked #8067

Open q2dg opened 6 years ago

q2dg commented 6 years ago

Submission type

systemd version the issue has been seen with

234 (kernel 4.14.15-300.fc27.x86_64)

Used distribution

Fedora

In case of bug report: Expected behaviour you didn't see

If I pulse ctrl+alt+fX to go to a previously masked ttyX I can login as usual and enter into shell. systemctl start doesn't work though (which is the expected behaviour). Thanks

yuwata commented 6 years ago

Could you test this with recent snapshot or Fedora rawhide? We usually accept bugs here on the recent two release, that is, v237 or v236. Fedora rawhide already has v237.

q2dg commented 6 years ago

Confirmed. Same wrong (?) behaviour in systemd v237 Kernel 4.15.0-1.fc28.x86_64 (Fedora Rawhide)

arvidjaar commented 6 years ago

logind spawns getty via autovt@ttyX.service, not via getty@ttyX.service. While autovt@.service itself is link to getty@.service, I am not sure whether systemd should in this case recognize that autovt@ttyX.service is effectively alias for getty@ttyX.service. I am afraid we have usual case of "systemd does not load everything so it does not and can not know that getty@ttyX.service is masked". It is not even clear whether we should consider getty@ttyX.service and autovt@ttyX.service to be aliases.

q2dg commented 6 years ago

@arvidjaar Yes, you're true, autovt@.service is a soft link to getty@.service and masking autovt itself does prohibit to enter in tty when pressing ctrl+alt+fX . Yes!! Thanks!!

But this behaviour isn't very logical...why autovt@.service works and getty@.service doesn't if former is simply a soft link to latter? I don't understand...si I'll leave this issue open, waiting for a reasoning.

Thanks

GrabbenD commented 2 months ago

This is really confusing 😞

# Misspelled
$ systemctl status autovt@2.sevice
â—‹ getty@2.sevice.service - Getty on 2.sevice
     Loaded: loaded (/usr/lib/systemd/system/getty@.service; disabled; preset: enabled)
     Active: inactive (dead)
       Docs: man:agetty(8)
             man:systemd-getty-generator(8)
             https://0pointer.de/blog/projects/serial-console.html
# OK
$ systemctl status autovt@tty2.service
â—‹ autovt@tty2.service - Getty on tty2
     Loaded: loaded (/usr/lib/systemd/system/getty@.service; masked; preset: enabled)
     Active: inactive (dead)
       Docs: man:agetty(8)
             man:systemd-getty-generator(8)
             https://0pointer.de/blog/projects/serial-console.html

Apr 30 21:10:32 archlinux login[7566]: pam_faillock(login:auth): Consecutive login failures for user game account temporarily locked
Apr 30 21:10:34 archlinux login[7566]: FAILED LOGIN 1 FROM tty2 FOR game, Authentication failure
Apr 30 21:11:15 archlinux systemd[1]: Stopping Getty on tty2...
Apr 30 21:11:15 archlinux systemd[1]: autovt@tty2.service: Deactivated successfully.
Apr 30 21:11:15 archlinux systemd[1]: Stopped Getty on tty2.
Apr 30 21:11:50 archlinux systemd[1]: Started Getty on tty2.
Apr 30 21:11:50 archlinux agetty[8223]: failed to open credentials directory
Apr 30 21:13:56 archlinux systemd[1]: Stopping Getty on tty2...
Apr 30 21:13:56 archlinux systemd[1]: autovt@tty2.service: Deactivated successfully.
Apr 30 21:13:56 archlinux systemd[1]: Stopped Getty on tty2.