You are not logged in.

#1 2021-04-01 09:48:06

Daiti
Member
Registered: 2020-07-13
Posts: 25

[SOLVED] Black screen at first login attempt

As the title says, I'm getting a weird behavior each time I boot up my arch linux installation. The display manager (lightdm in my case) starts, but all I can see is a black screen and the cursor. I'm sure the dm is running because I can easily login by pressing Enter, followed by the user password and Enter again. Once logged in I get (again) a black screen with the cursor visible. Nothing else, as if there is a problem loading the UI elements. The funny/interesting thing is that if I logout (using keyboard shortcut and a small dmenu script I wrote) I'm presented with the "right" login screen of lightdm, with my background, input field for the password etc, and once I log in (for the second time) everything loads as it should (I'm using i3wm).

It looks like this weird behavior started after linux 5.11.10 update (but I'm not sure the two are correlated).

Reading the .xsession-errors.old for the first login attempt I get:

Waiting for initial location to become available...
polybar|notice:  Parsing config file: /home/daiti/.config/polybar/config
polybar|notice:  Parsing config file: /home/daiti/.config/polybar/config
[ 04/01/2021 09:28:04.082 get_buffer_age WARN ] GLX_EXT_buffer_age not supported by your driver,`use-damage` has to be disabled
polybar|notice:  pulseaudio: using default sink alsa_output.usb-BurrBrown_from_Texas_Instruments_USB_AUDIO_CODEC-00.analog-stereo
polybar|notice:  pulseaudio: using default sink alsa_output.usb-BurrBrown_from_Texas_Instruments_USB_AUDIO_CODEC-00.analog-stereo
polybar|notice:  Loaded font "icomoon\-feather:style=Regular:size=9:antialias=true" (name=icomoon-feather, offset=3, file=/usr/share/fonts/TTF/icomoon-feather.ttf)
polybar|notice:  Loaded font "FixedsysExcelsiorIIIb Nerd Font:style=Regular:pixelsize=12:antialias=true" (name=FixedsysExcelsiorIIIb Nerd Font, offset=2, file=/usr/share/fonts/TTF/FixedsysExcelsiorNerdFont.ttf)
polybar|notice:  Loaded font "FontAwesome:style=Regular:size=7:antialias=false" (name=FixedsysExcelsiorIIIb Nerd Font, offset=1, file=/usr/share/fonts/TTF/FixedsysExcelsiorNerdFont.ttf)
polybar|notice:  Loaded font "typicons:style=Regular:size=9:antialias=true" (name=FixedsysExcelsiorIIIb Nerd Font, offset=2, file=/usr/share/fonts/TTF/FixedsysExcelsiorNerdFont.ttf)
polybar|warn:  Ignoring restack of i3 window (not needed when `override-redirect = false`)
polybar|notice:  Loaded font "icomoon\-feather:style=Regular:size=9:antialias=true" (name=icomoon-feather, offset=3, file=/usr/share/fonts/TTF/icomoon-feather.ttf)
polybar|notice:  Loaded font "FixedsysExcelsiorIIIb Nerd Font:style=Regular:pixelsize=12:antialias=true" (name=FixedsysExcelsiorIIIb Nerd Font, offset=2, file=/usr/share/fonts/TTF/FixedsysExcelsiorNerdFont.ttf)
polybar|notice:  Loaded font "FontAwesome:style=Regular:size=7:antialias=false" (name=FixedsysExcelsiorIIIb Nerd Font, offset=1, file=/usr/share/fonts/TTF/FixedsysExcelsiorNerdFont.ttf)
polybar|notice:  Loaded font "typicons:style=Regular:size=9:antialias=true" (name=FixedsysExcelsiorIIIb Nerd Font, offset=2, file=/usr/share/fonts/TTF/FixedsysExcelsiorNerdFont.ttf)
polybar|warn:  Ignoring restack of i3 window (not needed when `override-redirect = false`)
polybar|warn:  module/i3: Attempting to reconnect socket (reason: Unexpected EOF while reading header)
polybar|warn:  module/i3: Attempting to reconnect socket (reason: Unexpected EOF while reading header)
polybar|error: module/i3: Failed to reconnect socket (reason: Failed to connect to i3: errno 2 (No such file or directory))
polybar|error: module/i3: Failed to reconnect socket (reason: Failed to connect to i3: errno 2 (No such file or directory))
[ 04/01/2021 09:28:10.231 win_clear_flags WARN ] Flags cleared on a destroyed window 0x0040007b (polybar-primary_DP-0)
[ 04/01/2021 09:28:10.231 win_clear_flags WARN ] Flags cleared on a destroyed window 0x00400076 (polybar-secondary_HDMI-0)
X connection to :0 broken (explicit kill or server shutdown).
X connection to :0 broken (explicit kill or server shutdown).
X connection to :0 broken (explicit kill or server shutdown).
polybar|notice:  Termination signal received, shutting down...
polybar|notice:  Termination signal received, shutting down...

For reference, this is my lightdm.conf

#
# General configuration
#
# start-default-seat = True to always start one seat if none are defined in the configuration
# greeter-user = User to run greeter as
# minimum-display-number = Minimum display number to use for X servers
# minimum-vt = First VT to run displays on
# lock-memory = True to prevent memory from being paged to disk
# user-authority-in-system-dir = True if session authority should be in the system location
# guest-account-script = Script to be run to setup guest account
# logind-check-graphical = True to on start seats that are marked as graphical by logind
# log-directory = Directory to log information to
# run-directory = Directory to put running state in
# cache-directory = Directory to cache to
# sessions-directory = Directory to find sessions
# remote-sessions-directory = Directory to find remote sessions
# greeters-directory = Directory to find greeters
# backup-logs = True to move add a .old suffix to old log files when opening new ones
# dbus-service = True if LightDM provides a D-Bus service to control it
#
[LightDM]
#start-default-seat=true
#greeter-user=lightdm
#minimum-display-number=0
#minimum-vt=7 # Setting this to a value < 7 implies security issues, see FS#46799
#lock-memory=true
#user-authority-in-system-dir=false
#guest-account-script=guest-account
#logind-check-graphical=false
#log-directory=/var/log/lightdm
run-directory=/run/lightdm
#cache-directory=/var/cache/lightdm
#sessions-directory=/usr/share/lightdm/sessions:/usr/share/xsessions:/usr/share/wayland-sessions
#remote-sessions-directory=/usr/share/lightdm/remote-sessions
#greeters-directory=$XDG_DATA_DIRS/lightdm/greeters:$XDG_DATA_DIRS/xgreeters
#backup-logs=true
#dbus-service=true

#
# Seat configuration
#
# Seat configuration is matched against the seat name glob in the section, for example:
# [Seat:*] matches all seats and is applied first.
# [Seat:seat0] matches the seat named "seat0".
# [Seat:seat-thin-client*] matches all seats that have names that start with "seat-thin-client".
#
# type = Seat type (local, xremote)
# pam-service = PAM service to use for login
# pam-autologin-service = PAM service to use for autologin
# pam-greeter-service = PAM service to use for greeters
# xserver-command = X server command to run (can also contain arguments e.g. X -special-option)
# xmir-command = Xmir server command to run (can also contain arguments e.g. Xmir -special-option)
# xserver-config = Config file to pass to X server
# xserver-layout = Layout to pass to X server
# xserver-allow-tcp = True if TCP/IP connections are allowed to this X server
# xserver-share = True if the X server is shared for both greeter and session
# xserver-hostname = Hostname of X server (only for type=xremote)
# xserver-display-number = Display number of X server (only for type=xremote)
# xdmcp-manager = XDMCP manager to connect to (implies xserver-allow-tcp=true)
# xdmcp-port = XDMCP UDP/IP port to communicate on
# xdmcp-key = Authentication key to use for XDM-AUTHENTICATION-1 (stored in keys.conf)
# greeter-session = Session to load for greeter
# greeter-hide-users = True to hide the user list
# greeter-allow-guest = True if the greeter should show a guest login option
# greeter-show-manual-login = True if the greeter should offer a manual login option
# greeter-show-remote-login = True if the greeter should offer a remote login option
# user-session = Session to load for users
# allow-user-switching = True if allowed to switch users
# allow-guest = True if guest login is allowed
# guest-session = Session to load for guests (overrides user-session)
# session-wrapper = Wrapper script to run session with
# greeter-wrapper = Wrapper script to run greeter with
# guest-wrapper = Wrapper script to run guest sessions with
# display-setup-script = Script to run when starting a greeter session (runs as root)
# display-stopped-script = Script to run after stopping the display server (runs as root)
# greeter-setup-script = Script to run when starting a greeter (runs as root)
# session-setup-script = Script to run when starting a user session (runs as root)
# session-cleanup-script = Script to run when quitting a user session (runs as root)
# autologin-guest = True to log in as guest by default
# autologin-user = User to log in with by default (overrides autologin-guest)
# autologin-user-timeout = Number of seconds to wait before loading default user
# autologin-session = Session to load for automatic login (overrides user-session)
# autologin-in-background = True if autologin session should not be immediately activated
# exit-on-failure = True if the daemon should exit if this seat fails
#
[Seat:*]
#type=local
#pam-service=lightdm
#pam-autologin-service=lightdm-autologin
#pam-greeter-service=lightdm-greeter
#xserver-command=X
#xmir-command=Xmir
#xserver-config=
#xserver-layout=
#xserver-allow-tcp=false
#xserver-share=true
#xserver-hostname=
#xserver-display-number=
#xdmcp-manager=
#xdmcp-port=177
#xdmcp-key=
greeter-session=lightdm-webkit2-greeter
#greeter-hide-users=false
#greeter-allow-guest=true
#greeter-show-manual-login=false
#greeter-show-remote-login=true
#user-session=default
#allow-user-switching=true
allow-guest=false
#guest-session=
session-wrapper=/etc/lightdm/Xsession
#greeter-wrapper=
#guest-wrapper=
display-setup-script=/usr/bin/loginmonitor.sh
#display-stopped-script=
#greeter-setup-script=
#session-setup-script=
#session-cleanup-script=
#autologin-guest=false
#autologin-user=daiti
#autologin-user-timeout=0
#autologin-in-background=false
#autologin-session=
#exit-on-failure=false

#
# XDMCP Server configuration
#
# enabled = True if XDMCP connections should be allowed
# port = UDP/IP port to listen for connections on
# listen-address = Host/address to listen for XDMCP connections (use all addresses if not present)
# key = Authentication key to use for XDM-AUTHENTICATION-1 or blank to not use authentication (stored in keys.conf)
# hostname = Hostname to report to XDMCP clients (defaults to system hostname if unset)
#
# The authentication key is a 56 bit DES key specified in hex as 0xnnnnnnnnnnnnnn.  Alternatively
# it can be a word and the first 7 characters are used as the key.
#
[XDMCPServer]
#enabled=false
#port=177
#listen-address=
#key=
#hostname=

#
# VNC Server configuration
#
# enabled = True if VNC connections should be allowed
# command = Command to run Xvnc server with
# port = TCP/IP port to listen for connections on
# listen-address = Host/address to listen for VNC connections (use all addresses if not present)
# width = Width of display to use
# height = Height of display to use
# depth = Color depth of display to use
#
[VNCServer]
#enabled=false
#command=Xvnc
#port=5900
#listen-address=
#width=1024
#height=768
#depth=8

And this is the loginmonitor.sh script.

#!/bin/sh

xrandr --output DP-0 --primary

Anyone has an idea on how solve/diagnose this problem?

PS: I've tried to uninstall/reinstall lightdm a couple of times without solving the problem.

Last edited by Daiti (2021-04-02 07:35:23)

Offline

#2 2021-04-01 09:51:43

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,342

Re: [SOLVED] Black screen at first login attempt

And graphics card and driver? Generally this happens if xorg starts too early and before the graphics are initialized in which case you will want to read: https://wiki.archlinux.org/index.php/Ke … _KMS_start

Offline

#3 2021-04-01 10:05:29

Daiti
Member
Registered: 2020-07-13
Posts: 25

Re: [SOLVED] Black screen at first login attempt

GTX1050Ti with the latest nvidia drivers (460.67-1).

So I should try to edit the /etc/mkinitcpio.conf file adding nvidia nvidia_modeset nvidia_uvm nvidia_drm to MODULES?

Edit: I forgot to mention that the loginmonitor.sh does not run at boot. Even when the dm was working the login dialog box was on the second display, not the primary one (which is the DP-0).

Last edited by Daiti (2021-04-01 10:08:57)

Offline

#4 2021-04-01 10:15:33

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,342

Re: [SOLVED] Black screen at first login attempt

And then regenerate the relevant images with mkinitcpio yes.

if you happen to have a config generated for xorg, you should also either remove that or ensure that the nvidia module paths are loaded properly seee e.g. https://bbs.archlinux.org/viewtopic.php … 1#p1964881 as well.

As for the monitor script, is it executable for the lightdm user?

Offline

#5 2021-04-01 10:31:37

Daiti
Member
Registered: 2020-07-13
Posts: 25

Re: [SOLVED] Black screen at first login attempt

Is there an order or can I add the nvidia wherever I want in the MODULES line?

The xorg.conf was generated by nvidia-xconfig, but the lines

  ModulePath "/usr/lib/nvidia/xorg"
  ModulePath "/usr/lib/xorg/modules"

inside Section "Files" are not present, should I add them?

As for the script, I don't know how to check that, but I've followed the guide in the wiki https://wiki.archlinux.org/index.php/Li … ng_monitor but it was of no help, so I do not think this is the problem.

Offline

#6 2021-04-01 10:40:21

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,342

Re: [SOLVED] Black screen at first login attempt

If you have no real reason to have generated the xorg conf (read the only thing you did was run nvidia-xconfig) then you might as well remove the entire file as it doesn't do anything useful, if you've generated it to have a skeleton for modifying xorg options then you should add those lines at the very least yes.

The order shouldn't matter. As for the script if you've just created that in an editor it will not have the executable bits set, use chmod +x ... and this is a basic concept of how permissions work on an unix system you should familiarise yourself with: https://wiki.archlinux.org/index.php/Fi … attributes

Offline

#7 2021-04-01 10:49:05

Daiti
Member
Registered: 2020-07-13
Posts: 25

Re: [SOLVED] Black screen at first login attempt

Ok, so I can restore the old xorg.conf with no problem. That's nice. As for the script, I made it executable as soon as I closed the editor, I was just confused by the "is it executable for the lightdm user?" as if implying that there are different type of executable for each user.

To sum-up: I'll swap the xorg.conf generated by nvidia-xconfig for the original one, edit the MODULES line in /etc/mkinitcpio.conf and then regenerate the preset with mkinitcpio -P.

Am I missing something?

Offline

#8 2021-04-01 12:00:02

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,342

Re: [SOLVED] Black screen at first login attempt

There should be no original one, a static xorg.conf shouldn't exist on a normal install. What will exist are snippets in /usr/share/X11/xorg.conf.d as provided by a few packages (... including one for nvidia that sets the two lines I mentioned as part of the package, but you are overriding that with a static xorg.conf)

There are different types of permissions for different users. By default there's a differentiation between file owner, file group and "other" if you didn't chown the file to the lightdm user/group then "other" will be the relevant permission, if that lacks the executable bit the lightdm user won't be able to execute the script.

mkinitcpio steps read correct.

Offline

#9 2021-04-01 12:32:23

Daiti
Member
Registered: 2020-07-13
Posts: 25

Re: [SOLVED] Black screen at first login attempt

I checked cause I was not sure. The nvidia-xconfig actually creates a backup of xorg.conf when it is run. In the /etc/X11 folder I have xorg.conf and xorg.conf.backup, which (if I'm not mistaken) is the "original" config file.

$ ls /etc/X11
Permissions Size User Date Modified Name
drwxr-xr-x     - root 24 Mar 16:11  Xsession.d
drwxr-xr-x     - root 31 Jan 18:04  xinit
drwxr-xr-x     - root 31 Jan 18:15  xorg.conf.d
.rw-r--r--  1.8k root 31 Mar  9:12  xorg.conf
.rw-r--r--  1.7k root 31 Mar  9:12  xorg.conf.backup
.rw-r--r--  1.7k root 31 Mar  9:12  xorg.conf.nvidia-xconfig-original

As for the script's permissions, the group other already had the executable flag assigned. I actually made sure it was like that when I saved the script because I already knew the different permission flags (rwx) a file can have.

By the way, if I remove the xorg.conf file will it be regenerated next login or do I have to build it manually?

Last edited by Daiti (2021-04-01 12:36:39)

Offline

#10 2021-04-01 12:37:13

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,342

Re: [SOLVED] Black screen at first login attempt

You do not need one. If you don't have a xorg.conf xorg will automatically set up based on autodetection which should generally be preferred unless you have a specific reason for not using the autodetection. nvidia-xconfig creates a bloated and old configuration of how it used to work back when xorg didn't have proper autodetect.

Offline

#11 2021-04-01 12:40:47

Daiti
Member
Registered: 2020-07-13
Posts: 25

Re: [SOLVED] Black screen at first login attempt

Ok. That's new to me, glad you explained it.

I'll edit the file, regenerate the preset and delete the xorg config file, then I'll reboot and report back, hoping that the problem will be fixed.

EDIT: Everything works fine, the login screen is on the right monitor (finally), I just need to fix the script to set the relative position of the two monitors.

Thanks a lot for the quick help and the patience.

Just one question out of curiosity: what caused this problem? The kernel update? And do you think the xorg config was the reason the login screen was displayed in the wrong monitor?

Last edited by Daiti (2021-04-01 12:47:48)

Offline

Board footer

Powered by FluxBB