fairyglade / ly

display manager with console UI
Do What The F*ck You Want To Public License
5.36k stars 307 forks source link

Errors starting Xorg server with dwm in debian #462

Open arf20 opened 1 year ago

arf20 commented 1 year ago

Hello there, I'm getting weird issues with Xorg, when I try to login to dwm.

Xorg.0.log:
(--) controlling ty is VT number 2, auto-enabling KeepTty
(EE) systemd-logind: failed to get session: PID 1144 does not belong to any known session
[...]
(EE) xf86OpenConsole: cannot open virtual console 2 (Permission denied)

looking at the ly systemd unit:

ly.service:
pam_unix(ly:session): session opened for user arf20(uid=1000) by (uid=0)
pam_systemd(ly:session): Failed to create session: Connection reset by peer

Sounds like a weird bug with systemd-logind.

This is in Debian 11 stable in amd64, latest stable kernel, 5.10. Very recently compiled ly, with fairly recent dwm as well. Xorg version 1.20.11.

Using a .desktop file, /usr/share/xsessions/dwm.desktop:

[Desktop Entry]
Version=1.0
Type=Application
Name=dwm
Comment=Dynamic Window Manager
Exec=/home/arf20/.dwmxinitrc
Icon=
Path=
Terminal=false
StartupNotify=false

And ~/.dwmxinitrc as follows:

#!/bin/sh
xcompmgr -c &
feh --bg-scale /usr/share/backgrounds/rtelescope.jpg
xsetroot -name "laptop"
slstatus &
pulseaudio --start
exec dwm

The thing is startx ~/.dwmxinitrc works in a console. Also lightdm + dwm works, and ly + xfce also works, only fails with dwm (haven't tried other simple WMs). Also launching ly as root from a console also does work.

At boot /dev/tty* are owned by root:tty, but iirc some mechanism (dbus?) has to chown it to my user? But somehow that is not happening (startx has that mechanism?). Also tried Exec=startx /home/arf20/.dwmxinitrc but I don't know how I expected that to work. Same failure mode.

Both services dbus and systemd-logind are running and do work.

Anyone having the same problem? I think you could easily replicate in a clean Debian install with ly and dwm. I just found the same problem in a brand new install of Debian i386 in a ThinkPad R51, very nice laptop btw.

Thanks for reading

winstxnhdw commented 12 months ago

Have you been able to solve this?

arf20 commented 12 months ago

No :/

winstxnhdw commented 12 months ago

Haha, I have been trying to fix this issue for 2 years now. It only happens on my laptop..

AnErrupTion commented 5 months ago

This is a strange issue. I'll try to reproduce it in the upcoming days (if I don't forget that is... 😅).

blmayer commented 2 months ago

I was having the same issue here, I solved it by adding #!/bin/sh to the .xinitrc file, and making it executable.

AnErrupTion commented 2 months ago

I was having the same issue here, I solved it by adding #!/bin/sh to the .xinitrc file, and making it executable.

Making the .xinitrc file executable is specified in the README. It is a script after all!