You are not logged in.

#1 2017-02-04 16:00:28

Makishima
Member
Registered: 2017-02-04
Posts: 6

[SOLVED]Autologin on tty1 fails

Dear Arch Linux Community,

I have started using Arch two weeks ago, but have used mainstream Linux distros for four years now. I installed Arch on an external HD for testing and would like to go the minimalistic way: no desktop environment, i3 as a windows manager.

However, I am encountering difficulties with autologin on tty1. Manual login into tty1 as root or as user both work. But after setting up the automatic login for the user on the virtual console, the screen goes black for one second after the GRUB menu, and then the boot process hangs. From there I can only login with another tty. I updated the system with

pacman -Syu

to rule out the possibility of an outdated system.

I have followed the Arch Linux Wiki: Getty. I have run:

systemctl edit getty@tty1

and modified the file

/etc/systemd/system/getty@tty1.service.d/override.conf

whose contents now are:

[Service]
Type=simple
ExecStart=
ExecStart=-/usr/bin/agetty --autologin alex --noclear %I $TERM

On one occasion there was an error text showing after the failed boot, it read:

Failed to start getty on tty1
See 'systemctl status getty@tty1.service' for details
Stopping user manager for UID 1000
Stopped user manager for UID 1000
Removed slice User Slice of alex
Started update man-db cache

The last time I tried running

systemctl status getty@tty1.service

it showed me that tty1 was inactive. I have not been able to find how to activate it.

At the same time, I have also setup X to autostart at login in order to launch i3 automatically, following again the xinit page of the wiki. I.e., I modified

~/.bash_profile

with the following code:

if [ -z "$DISPLAY" ] && [ -n "$XDG_VTNR" ] && [ "$XDG_VTNR" -eq 1 ]; then
  exec startx
fi

.

If anyone has a suggestion or a solution to this, I would be very grateful. Don't hesitate to ask if you need more details on this. Cheers!

Last edited by Makishima (2017-02-05 16:58:32)

Offline

#2 2017-02-04 16:20:52

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: [SOLVED]Autologin on tty1 fails

What are the contents of /etc/X11/Xwrapper.config. Also, get rid of the

Type=simple

part of the service file, though it shouldn't make any difference.

Offline

#3 2017-02-04 16:32:39

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,463

Re: [SOLVED]Autologin on tty1 fails

Get rid of the .bash_profile, see if it's a problem with autologin or with X.

Offline

#4 2017-02-04 18:04:28

Makishima
Member
Registered: 2017-02-04
Posts: 6

Re: [SOLVED]Autologin on tty1 fails

Thanks to both of you for your swiftness and your suggestions.
@x33a: The file etc/X11/Xwrapper.config does not exist on my hard drive. I don't recall this file being mentioned in the wiki either. Does it provide a way to get the autologin going, and if so, how?
Also, I removed

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.

Last edited by Makishima (2017-02-04 18:05:07)

Offline

#5 2017-02-04 20:59:41

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: [SOLVED]Autologin on tty1 fails

I've never used ther "$TERM" variable in a call to agetty there.  I've explicitly set it to "linux" which used to be in the wiki.  Can anyone confirm whether putting a variable there will work?  I thought the TERM environment variable was set by the getty process - if so it can be used as a parameter to agetty.

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

"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#6 2017-02-04 21:09:44

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,680
Website

Re: [SOLVED]Autologin on tty1 fails

Trilby wrote:

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: ~ $

smile

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

Last edited by Head_on_a_Stick (2017-02-04 21:12:38)

Online

#7 2017-02-05 08:34:35

Makishima
Member
Registered: 2017-02-04
Posts: 6

Re: [SOLVED]Autologin on tty1 fails

@Trilby: I was wondering about the "$TERM" variable too, but I decided to keep it since it was on the current wiki page.

@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)

Last edited by Makishima (2017-02-05 11:43:37)

Offline

#8 2017-02-05 11:18:17

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,680
Website

Re: [SOLVED]Autologin on tty1 fails

How strange hmm

Please replace those quote tags with code tags and also post the output of:

systemctl cat --no-pager getty@tty1.service

Online

#9 2017-02-05 12:40:03

cirrus
Member
From: Glasgow Scotland
Registered: 2012-08-24
Posts: 340
Website

Re: [SOLVED]Autologin on tty1 fails

From above log i see this

]: 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

Last edited by cirrus (2017-02-05 12:47:52)

Offline

#10 2017-02-05 12:44:11

Makishima
Member
Registered: 2017-02-04
Posts: 6

Re: [SOLVED]Autologin on tty1 fails

@Head_on_a_Stick: Ok, I wasn't sure this counted as code text - the post has been edited accordingly. Thanks for your help.

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.

Offline

#11 2017-02-05 12:50:54

Awebb
Member
Registered: 2010-05-06
Posts: 6,272

Re: [SOLVED]Autologin on tty1 fails

This has been failing for a week or so since after an update: $XDG_VTNR is no longer set. I had to use the alternative terminal detection method from the wiki.

Offline

#12 2017-02-05 13:15:37

cirrus
Member
From: Glasgow Scotland
Registered: 2012-08-24
Posts: 340
Website

Re: [SOLVED]Autologin on tty1 fails

On a couple of my arch installs,  env shows:

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 ?

Last edited by cirrus (2017-02-05 13:16:13)

Offline

#13 2017-02-05 14:53:52

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,680
Website

Re: [SOLVED]Autologin on tty1 fails

Makishima wrote:

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

Online

#14 2017-02-05 15:29:19

Makishima
Member
Registered: 2017-02-04
Posts: 6

Re: [SOLVED]Autologin on tty1 fails

@Awebb: Interesting. Would you be so kind as to point me to the relevant wiki pages on alternative terminal detection, because from your post, I don't know which pages you mean - a wiki search on terminal detection did not return anything that seemed relevant to the current issue either. Thanks for your contribution, though!

@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.

Offline

#15 2017-02-05 15:43:54

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,680
Website

Re: [SOLVED]Autologin on tty1 fails

Your /etc/systemd/system is severely under-populated...

Specifically, you are lacking /etc/systemd/system/getty.target.wants hmm

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
Makishima wrote:

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 wink

Online

#16 2017-02-05 16:09:43

Makishima
Member
Registered: 2017-02-04
Posts: 6

Re: [SOLVED]Autologin on tty1 fails

Yay! Head_on_a_Stick got the answer!
So I entered

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.

Last edited by Makishima (2017-02-05 16:55:14)

Offline

Board footer

Powered by FluxBB