systemctl enable getty@tty1.service
, which repopulated my /etc/systemd/system folder, i.e. /etc/systemd/system/getty.target.wants appeared. I rebooted.
A new error message appeared, saying:
login: username (automatic login)
user not know to the underlying authentication module
I surmised that the /etc/systemd/system/getty@tty1.service.d/override.conf had the value "username" instead of my actual username. So I edited the file accordingly. Reboot. Boom! Automatic login works.
Thanks to all, especially Head_on_a_Stick for taking the time to read and solve this together. I'll mark the topic as solved.
]]>Specifically, you are lacking /etc/systemd/system/getty.target.wants
Try:
# systemctl enable getty@tty1.service
If that doesn't work then try:
# mkdir -p /etc/systemd/system/getty.target.wants
# ln -s /usr/lib/systemd/system/getty@.service /etc/systemd/system/getty.target.wants/getty@tty1.service
alternative terminal detection
I use this line in ~/.profile:
[ "$(tty)" = "/dev/tty1" ] && exec startx
But of course $XDG_VTNR has nothing to do with the problem in hand
]]>@Head_on_a_Stick: Ok, here we go. When I enter
systemctl status getty@tty1.service
I get
Loaded: loaded (/usr/lib/systemd/system/getty@.service; disabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/getty@tty1.service.d
ââoverride.conf
Active: inactive (dead)
Docs: man:agetty(8)
man:systemd-getty-generator(8)
http://0pointer.de/blog/projects/serial-console.html
â getty@tty1.service - Getty on tty1
Loaded: loaded (/usr/lib/systemd/system/getty@.service; disabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/getty@tty1.service.d
ââoverride.conf
Active: inactive (dead)
Docs: man:agetty(8)
man:systemd-getty-generator(8)
http://0pointer.de/blog/projects/serial-console.html
And when I enter
ls -lR /etc/systemd/system
I get
/etc/systemd/system:
total 8
lrwxrwxrwx 1 root root 46 Feb 1 17:58 dbus-org.freedesktop.NetworkManager.service -> /usr/lib/systemd/system/NetworkManager.service
lrwxrwxrwx 1 root root 57 Feb 1 17:58 dbus-org.freedesktop.nm-dispatcher.service -> /usr/lib/systemd/system/NetworkManager-dispatcher.service
lrwxrwxrwx 1 root root 41 Feb 4 12:22 default.target -> /usr/lib/systemd/system/multi-user.target
drwxr-xr-x 2 root root 4096 Feb 5 12:07 getty@tty1.service.d
drwxr-xr-x 2 root root 4096 Feb 5 15:13 multi-user.target.wants
/etc/systemd/system/getty@tty1.service.d:
total 4
-rw-r--r-- 1 root root 88 Feb 5 12:07 override.conf
/etc/systemd/system/multi-user.target.wants:
total 0
lrwxrwxrwx 1 root root 39 Feb 5 15:13 dhcpcd@enp1s7.service -> /usr/lib/systemd/system/dhcpcd@.service
So what I should find out now is how to activate getty@tty1.service, I guess.
]]>a couple of ideas, like adding the username in "ExecStart=-/sbin/agetty user --noclear %I $TERM" and maybe setting "Restart=0" instead of "Restart=always". What do you think?
No, you should use the override.conf file to make any changes, I wanted to see the base unit file to check if any modifications had been made (they have not).
You shouldn't have to hack basic system files to get this working, there must be some misconfiguration elsewhere.
You described this output earlier rather than posting it so can we actually see:
systemctl status getty@tty1.service
Please also post the full output of:
ls -lR /etc/systemd/system
XDG_VTNR=1
and i don't *think* i have set it manually anywhere, so i don't know why autologin/autostart X continues to work for me, maybe the fact i'm using just a WM ?
]]>After entering
systemctl cat --no-pager getty@tty1.service
I get the following:
# /usr/lib/systemd/system/getty@.service
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
[Unit]
Description=Getty on %I
Documentation=man:agetty(8) man:systemd-getty-generator(8)
Documentation=http://0pointer.de/blog/projects/serial-console.html
After=systemd-user-sessions.service plymouth-quit-wait.service
# If additional gettys are spawned during boot then we should make
# sure that this is synchronized before getty.target, even though
# getty.target didn't actually pull it in.
Before=getty.target
IgnoreOnIsolate=yes
# IgnoreOnIsolate causes issues with sulogin, if someone isolates
# rescue.target or starts rescue.service from multi-user.target or
# graphical.target.
Conflicts=rescue.service
Before=rescue.service
# On systems without virtual consoles, don't start any getty. Note
# that serial gettys are covered by serial-getty@.service, not this
# unit.
ConditionPathExists=/dev/tty0
[Service]
# the VT is cleared by TTYVTDisallocate
ExecStart=-/sbin/agetty --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
# Unset locale for the console getty since the console has problems
# displaying some internationalized messages.
Environment=LANG= LANGUAGE= LC_CTYPE= LC_NUMERIC= LC_TIME= LC_COLLATE= LC_MONETARY= LC_MESSAGES= LC_PAPER= LC_NAME= LC_ADDRESS= LC_TELEPHONE= LC_MEASUREMENT= LC_IDENTIFICATION=
[Install]
WantedBy=getty.target
DefaultInstance=tty1
Which gives me a couple of ideas, like adding the username in "ExecStart=-/sbin/agetty user --noclear %I $TERM" and maybe setting "Restart=0" instead of "Restart=always". What do you think?
By the way, I have tried to setup the autologin with a serial console and a nspawn console, both without any success.
]: getty@tty1.service: Service has no hold-off time, scheduling restart.
I was wondering if the numbers i have in override.conf may be a factor
ExecStart=-/usr/bin/agetty --autologin cirrus --noclear %I 38400 linux
Also if you have any, ensure any installed Desktop Managers are removed or disabled.
run this if you havent already
sudo systemctl enable getty@tty1.service
Please replace those quote tags with code tags and also post the output of:
systemctl cat --no-pager getty@tty1.service
@Head_on_a_Stick: Good point. See the log below. The key parts are those error messages, I think: "Service has no hold-off time, scheduling restart.", "Start request repeated too quickly.", and "Failed with result 'start-limit-hit'."
There are few posts about those errors on the web, nothing that could help so far.
Feb 03 20:18:30 Alex systemd[1]: Started Getty on tty1.
Feb 03 20:18:30 Alex login[411]: pam_unix(login:session): session opened for user alex by LOGIN(uid=0)
Feb 03 20:18:30 Alex systemd[1]: getty@tty1.service: Service has no hold-off time, scheduling restart.
Feb 03 20:18:30 Alex systemd[1]: Stopped Getty on tty1.
Feb 03 20:18:30 Alex systemd[1]: Started Getty on tty1.
Feb 03 20:18:30 Alex login[421]: pam_unix(login:session): session opened for user alex by LOGIN(uid=0)
Feb 03 20:18:31 Alex systemd[1]: getty@tty1.service: Service has no hold-off time, scheduling restart.
Feb 03 20:18:31 Alex systemd[1]: Stopped Getty on tty1.
Feb 03 20:18:31 Alex systemd[1]: Started Getty on tty1.
Feb 03 20:18:31 Alex login[437]: pam_unix(login:session): session opened for user alex by LOGIN(uid=0)
Feb 03 20:18:31 Alex systemd[1]: getty@tty1.service: Service has no hold-off time, scheduling restart.
Feb 03 20:18:31 Alex systemd[1]: Stopped Getty on tty1.
Feb 03 20:18:31 Alex systemd[1]: Started Getty on tty1.
Feb 03 20:18:31 Alex login[454]: pam_unix(login:session): session opened for user alex by LOGIN(uid=0)
Feb 03 20:18:31 Alex systemd[1]: getty@tty1.service: Service has no hold-off time, scheduling restart.
Feb 03 20:18:31 Alex systemd[1]: Stopped Getty on tty1.
Feb 03 20:18:31 Alex systemd[1]: Started Getty on tty1.
Feb 03 20:18:31 Alex login[470]: pam_unix(login:session): session opened for user alex by LOGIN(uid=0)
Feb 03 20:18:31 Alex systemd[1]: getty@tty1.service: Service has no hold-off time, scheduling restart.
Feb 03 20:18:31 Alex systemd[1]: Stopped Getty on tty1.
Feb 03 20:18:31 Alex systemd[1]: getty@tty1.service: Start request repeated too quickly.
Feb 03 20:18:31 Alex systemd[1]: Failed to start Getty on tty1.
Feb 03 20:18:31 Alex systemd[1]: getty@tty1.service: Unit entered failed state.
Feb 03 20:18:31 Alex systemd[1]: getty@tty1.service: Failed with result 'start-limit-hit'.
-- Reboot --
Feb 03 20:23:00 Alex systemd[1]: Started Getty on tty1.
Feb 03 20:23:01 Alex login[404]: pam_unix(login:session): session opened for user alex by LOGIN(uid=0)
Feb 03 20:23:01 Alex systemd[1]: getty@tty1.service: Service has no hold-off time, scheduling restart.
Feb 03 20:23:01 Alex systemd[1]: Stopped Getty on tty1.
Feb 03 20:23:01 Alex systemd[1]: Started Getty on tty1.
Feb 03 20:23:01 Alex login[414]: pam_unix(login:session): session opened for user alex by LOGIN(uid=0)
Feb 03 20:23:01 Alex systemd[1]: getty@tty1.service: Service has no hold-off time, scheduling restart.
Feb 03 20:23:01 Alex systemd[1]: Stopped Getty on tty1.
Feb 03 20:23:01 Alex systemd[1]: Started Getty on tty1.
Feb 03 20:23:01 Alex login[428]: pam_unix(login:session): session opened for user alex by LOGIN(uid=0)
Feb 03 20:23:01 Alex systemd[1]: getty@tty1.service: Service has no hold-off time, scheduling restart.
Feb 03 20:23:01 Alex systemd[1]: Stopped Getty on tty1.
Feb 03 20:23:01 Alex systemd[1]: Started Getty on tty1.
Feb 03 20:23:01 Alex login[444]: pam_unix(login:session): session opened for user alex by LOGIN(uid=0)
Feb 03 20:23:01 Alex systemd[1]: getty@tty1.service: Service has no hold-off time, scheduling restart.
Feb 03 20:23:01 Alex systemd[1]: Stopped Getty on tty1.
Feb 03 20:23:01 Alex systemd[1]: Started Getty on tty1.
Feb 03 20:23:01 Alex login[460]: pam_unix(login:session): session opened for user alex by LOGIN(uid=0)
Feb 03 20:23:02 Alex systemd[1]: getty@tty1.service: Service has no hold-off time, scheduling restart.
Feb 03 20:23:02 Alex systemd[1]: Stopped Getty on tty1.
Feb 03 20:23:02 Alex systemd[1]: getty@tty1.service: Start request repeated too quickly.
Feb 03 20:23:02 Alex systemd[1]: Failed to start Getty on tty1.
Feb 03 20:23:02 Alex systemd[1]: getty@tty1.service: Unit entered failed state.
Feb 03 20:23:02 Alex systemd[1]: getty@tty1.service: Failed with result 'start-limit-hit'.
-- Reboot --
Feb 03 20:24:11 Alex systemd[1]: Started Getty on tty1.
Feb 03 20:24:11 Alex login[407]: pam_unix(login:session): session opened for user alex by LOGIN(uid=0)
Feb 03 20:24:11 Alex systemd[1]: getty@tty1.service: Service has no hold-off time, scheduling restart.
Feb 03 20:24:11 Alex systemd[1]: Stopped Getty on tty1.
Feb 03 20:24:11 Alex systemd[1]: Started Getty on tty1.
Feb 03 20:24:11 Alex login[417]: pam_unix(login:session): session opened for user alex by LOGIN(uid=0)
Feb 03 20:24:12 Alex systemd[1]: getty@tty1.service: Service has no hold-off time, scheduling restart.
Feb 03 20:24:12 Alex systemd[1]: Stopped Getty on tty1.
Feb 03 20:24:12 Alex systemd[1]: Started Getty on tty1.
Feb 03 20:24:12 Alex login[430]: pam_unix(login:session): session opened for user alex by LOGIN(uid=0)
Feb 03 20:24:12 Alex systemd[1]: getty@tty1.service: Service has no hold-off time, scheduling restart.
Feb 03 20:24:12 Alex systemd[1]: Stopped Getty on tty1.
Feb 03 20:24:12 Alex systemd[1]: Started Getty on tty1.
Feb 03 20:24:12 Alex login[448]: pam_unix(login:session): session opened for user alex by LOGIN(uid=0)
Feb 03 20:24:12 Alex systemd[1]: getty@tty1.service: Service has no hold-off time, scheduling restart.
Feb 03 20:24:12 Alex systemd[1]: Stopped Getty on tty1.
Feb 03 20:24:12 Alex systemd[1]: Started Getty on tty1.
Feb 03 20:24:12 Alex login[464]: pam_unix(login:session): session opened for user alex by LOGIN(uid=0)
Feb 03 20:24:12 Alex systemd[1]: getty@tty1.service: Service has no hold-off time, scheduling restart.
Feb 03 20:24:12 Alex systemd[1]: Stopped Getty on tty1.
Feb 03 20:24:12 Alex systemd[1]: getty@tty1.service: Start request repeated too quickly.
Feb 03 20:24:12 Alex systemd[1]: Failed to start Getty on tty1.
Feb 03 20:24:12 Alex systemd[1]: getty@tty1.service: Unit entered failed state.
Feb 03 20:24:12 Alex systemd[1]: getty@tty1.service: Failed with result 'start-limit-hit'.
-- Reboot --
Feb 03 20:33:16 Alex systemd[1]: Started Getty on tty1.
Feb 03 20:33:16 Alex login[403]: pam_unix(login:session): session opened for user alex by LOGIN(uid=0)
Feb 03 20:33:17 Alex systemd[1]: getty@tty1.service: Service has no hold-off time, scheduling restart.
Feb 03 20:33:17 Alex systemd[1]: Stopped Getty on tty1.
Feb 03 20:33:17 Alex systemd[1]: Started Getty on tty1.
Feb 03 20:33:17 Alex login[414]: pam_unix(login:session): session opened for user alex by LOGIN(uid=0)
Feb 03 20:33:17 Alex systemd[1]: getty@tty1.service: Service has no hold-off time, scheduling restart.
Feb 03 20:33:17 Alex systemd[1]: Stopped Getty on tty1.
Feb 03 20:33:17 Alex systemd[1]: Started Getty on tty1.
Feb 03 20:33:17 Alex login[427]: pam_unix(login:session): session opened for user alex by LOGIN(uid=0)
Feb 03 20:33:17 Alex systemd[1]: getty@tty1.service: Service has no hold-off time, scheduling restart.
Feb 03 20:33:17 Alex systemd[1]: Stopped Getty on tty1.
Feb 03 20:33:17 Alex systemd[1]: Started Getty on tty1.
Feb 03 20:33:17 Alex login[440]: pam_unix(login:session): session opened for user alex by LOGIN(uid=0)
Feb 03 20:33:17 Alex systemd[1]: getty@tty1.service: Service has no hold-off time, scheduling restart.
Feb 03 20:33:17 Alex systemd[1]: Stopped Getty on tty1.
Feb 03 20:33:17 Alex systemd[1]: Started Getty on tty1.
Feb 03 20:33:17 Alex login[457]: pam_unix(login:session): session opened for user alex by LOGIN(uid=0)
Feb 03 20:33:17 Alex systemd[1]: getty@tty1.service: Service has no hold-off time, scheduling restart.
Feb 03 20:33:17 Alex systemd[1]: Stopped Getty on tty1.
Feb 03 20:33:17 Alex systemd[1]: getty@tty1.service: Start request repeated too quickly.
Feb 03 20:33:17 Alex systemd[1]: Failed to start Getty on tty1.
Feb 03 20:33:17 Alex systemd[1]: getty@tty1.service: Unit entered failed state.
Feb 03 20:33:17 Alex systemd[1]: getty@tty1.service: Failed with result 'start-limit-hit'.
-- Reboot --
Feb 04 10:43:01 Alex systemd[1]: Started Getty on tty1.
Feb 04 10:43:02 Alex login[1095]: pam_unix(login:session): session opened for user alex by LOGIN(uid=0)
Feb 04 10:43:02 Alex systemd[1]: getty@tty1.service: Service has no hold-off time, scheduling restart.
Feb 04 10:43:02 Alex systemd[1]: Stopped Getty on tty1.
Feb 04 10:43:02 Alex systemd[1]: Started Getty on tty1.
Feb 04 10:43:02 Alex login[1167]: pam_unix(login:session): session opened for user alex by LOGIN(uid=0)
Feb 04 10:43:02 Alex systemd[1]: getty@tty1.service: Service has no hold-off time, scheduling restart.
Feb 04 10:43:02 Alex systemd[1]: Stopped Getty on tty1.
Feb 04 10:43:02 Alex systemd[1]: Started Getty on tty1.
Feb 04 10:43:02 Alex login[1209]: pam_unix(login:session): session opened for user alex by LOGIN(uid=0)
Feb 04 10:43:02 Alex systemd[1]: getty@tty1.service: Service has no hold-off time, scheduling restart.
Feb 04 10:43:02 Alex systemd[1]: Stopped Getty on tty1.
Feb 04 10:43:02 Alex systemd[1]: Started Getty on tty1.
Feb 04 10:43:03 Alex login[1268]: pam_unix(login:session): session opened for user alex by LOGIN(uid=0)
Feb 04 10:43:03 Alex systemd[1]: getty@tty1.service: Service has no hold-off time, scheduling restart.
Feb 04 10:43:03 Alex systemd[1]: Stopped Getty on tty1.
Feb 04 10:43:03 Alex systemd[1]: Started Getty on tty1.
Feb 04 10:43:03 Alex login[1320]: pam_unix(login:session): session opened for user alex by LOGIN(uid=0)
Feb 04 10:43:03 Alex systemd[1]: getty@tty1.service: Service has no hold-off time, scheduling restart.
Feb 04 10:43:03 Alex systemd[1]: Stopped Getty on tty1.
Feb 04 10:43:03 Alex systemd[1]: getty@tty1.service: Start request repeated too quickly.
Feb 04 10:43:03 Alex systemd[1]: Failed to start Getty on tty1.
Feb 04 10:43:03 Alex systemd[1]: getty@tty1.service: Unit entered failed state.
Feb 04 10:43:03 Alex systemd[1]: getty@tty1.service: Failed with result 'start-limit-hit'.
-- Reboot --
Feb 04 10:56:00 Alex systemd[1]: Started Getty on tty1.
Feb 04 10:56:00 Alex login[411]: pam_unix(login:session): session opened for user alex by LOGIN(uid=0)
Feb 04 10:56:01 Alex systemd[1]: getty@tty1.service: Service has no hold-off time, scheduling restart.
Feb 04 10:56:01 Alex systemd[1]: Stopped Getty on tty1.
Feb 04 10:56:01 Alex systemd[1]: Started Getty on tty1.
Feb 04 10:56:01 Alex login[421]: pam_unix(login:session): session opened for user alex by LOGIN(uid=0)
Feb 04 10:56:01 Alex systemd[1]: getty@tty1.service: Service has no hold-off time, scheduling restart.
Feb 04 10:56:01 Alex systemd[1]: Stopped Getty on tty1.
Feb 04 10:56:01 Alex systemd[1]: Started Getty on tty1.
Feb 04 10:56:01 Alex login[435]: pam_unix(login:session): session opened for user alex by LOGIN(uid=0)
Feb 04 10:56:01 Alex systemd[1]: getty@tty1.service: Service has no hold-off time, scheduling restart.
Feb 04 10:56:01 Alex systemd[1]: Stopped Getty on tty1.
Feb 04 10:56:01 Alex systemd[1]: Started Getty on tty1.
Feb 04 10:56:01 Alex login[452]: pam_unix(login:session): session opened for user alex by LOGIN(uid=0)
Feb 04 10:56:01 Alex systemd[1]: getty@tty1.service: Service has no hold-off time, scheduling restart.
Feb 04 10:56:01 Alex systemd[1]: Stopped Getty on tty1.
Feb 04 10:56:01 Alex systemd[1]: Started Getty on tty1.
Feb 04 10:56:01 Alex login[465]: pam_unix(login:session): session opened for user alex by LOGIN(uid=0)
Feb 04 10:56:01 Alex systemd[1]: getty@tty1.service: Service has no hold-off time, scheduling restart.
Feb 04 10:56:01 Alex systemd[1]: Stopped Getty on tty1.
Feb 04 10:56:01 Alex systemd[1]: getty@tty1.service: Start request repeated too quickly.
Feb 04 10:56:01 Alex systemd[1]: Failed to start Getty on tty1.
Feb 04 10:56:01 Alex systemd[1]: getty@tty1.service: Unit entered failed state.
Feb 04 10:56:01 Alex systemd[1]: getty@tty1.service: Failed with result 'start-limit-hit'.
-- Reboot --
Feb 04 11:09:31 Alex systemd[1]: Started Getty on tty1.
Feb 04 11:09:43 Alex login[408]: pam_unix(login:session): session opened for user root by LOGIN(uid=0)
Feb 04 11:28:47 Alex systemd[1]: Stopping Getty on tty1...
Feb 04 11:28:48 Alex systemd[1]: Stopped Getty on tty1.
-- Reboot --
Feb 04 11:29:31 Alex systemd[1]: Started Getty on tty1.
Feb 04 11:29:39 Alex login[414]: pam_unix(login:session): session opened for user root by LOGIN(uid=0)
Feb 04 11:30:17 Alex systemd[1]: Stopping Getty on tty1...
Feb 04 11:30:18 Alex systemd[1]: Stopped Getty on tty1.
-- Reboot --
Feb 04 11:30:57 Alex systemd[1]: Started Getty on tty1.
Feb 04 11:31:24 Alex login[406]: pam_unix(login:session): session opened for user root by LOGIN(uid=0)
Can anyone confirm whether putting a variable there will work?
Works for me:
TheLab: ~ $ cat /etc/systemd/system/getty@tty1.service.d/override.conf
[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin empty --noclear %I $TERM
TheLab: ~ $
EDIT: that's from a Debian system but I have the same syntax in my Arch box.
EDIT2: @OP: I think we need to see the journal contents:
journalctl -u getty@tty1.service
Even if TERM is set by a parent of the agetty process, I still don't think service files can use them in the Exec line like that. The Exec line is *not* parsed by a shell interpreter - so the variable will not be expanded.
My autologin excerpt, for reference:
[Service]
ExecStart=
ExecStart=/usr/bin/agetty --autologin jmcclure --noclear %I 38400 linux
Type=simple
Type=simple
from the file /etc/systemd/system/getty@tty1.service.d/override.conf. As you correctly guessed, this has no effect on the autologin for me.
@Scimmia: I have just deleted ~/.bash_profile, but this does not affect the autologin situation; I still end up having to login manually via tty2.
I'm maybe going to have a go at setting the autologin via a serial console and a Nspawn console to see if I can succeed there. See https://wiki.archlinux.org/index.php/Ge … al_console for more.
]]>Type=simple
part of the service file, though it shouldn't make any difference.
]]>