Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uwsm stop doesn't restart sddm? #92

Open
LukeXuan opened this issue Feb 7, 2025 · 12 comments
Open

uwsm stop doesn't restart sddm? #92

LukeXuan opened this issue Feb 7, 2025 · 12 comments

Comments

@LukeXuan
Copy link

LukeXuan commented Feb 7, 2025

Is uwsm stop supposed to be the command used for user logout? I was starting to adopt uwsm for Hyprland, but I cannot solve the problem that after logout sddm login screen doesn't appear. Here's my setup,

/usr/share/wayland-sessions/uwsm.desktop:

[Desktop Entry]
Name=Hyprland (UWSM)
Exec=uwsm start -- hyprland.desktop
Type=Application

hyprland.conf:

bind = $mainMod ALT SHIFT, E, exec, uwsm stop

With uwsm stop, I can see the following journal entries in jounrnalctl:

Feb 07 14:34:59 sddm[1750]: Auth: sddm-helper exited with 1
Feb 07 14:34:59 systemd[1]: session-2.scope: Deactivated successfully.
Feb 07 14:34:59 systemd-logind[1420]: Session 2 logged out. Waiting for processes to exit.
Feb 07 14:34:59 systemd-logind[1420]: Removed session 2.

While with hyprland native exit, I can see the following two extra journal entries (along with the other sddm entries leading to restart):

Feb 07 14:51:55 sddm-helper[2336]: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8.
                                   Qt depends on a UTF-8 locale, and has switched to "C.UTF-8" instead.
                                   If this causes problems, reconfigure your locale. See the locale(1) manual
                                   for more information.
Feb 07 14:51:55 sddm-helper[2336]: pam_unix(sddm-greeter:session): session opened for user sddm(uid=985) by (uid=0)

I wonder if I'm using uwsm stop for its intended purpose? If not, what is the correct command to achieve user logout?

I was totally wrong in my initial writing. Hyprland seems to cause coredump regardless of stopping method, the difference is that native exit will triger sddm login screen but uwsm stop won't.

@LukeXuan LukeXuan changed the title uwsm stop crashes hyprland? uwsm stop doesn't restart sddm? Feb 7, 2025
@Vladimir-csp
Copy link
Owner

When stop is initiated, do app units stop first? Nothing special should happen, systemd should just stop whatever should be stopped before compositor's unit, then stop the comopositor's unit itself (TERM is sent), then deactivate environment preloader.

Does killall Hyprland crash it?

@LukeXuan
Copy link
Author

LukeXuan commented Feb 7, 2025

I'm sorry, I reached the conclusion too soon. Please check my new writeup. It seems like hyprland always crashes on my machine, just that sddm doesn't reappear with uwsm stop but reappears with hyprland native exit (and not using uwsm start at all).

@Vladimir-csp
Copy link
Owner

uwsm stop is essentially the same as systemctl --user stop wayland-wm@*.service. With the end of compositor a process holding login session open also ends, session should close. This is either reflected in your log, or it's another session for a manager process or sddm-helper, and some process got stuck.

What does systemctl status show after uwsm stop? Note $XDG_SESSION_ID in graphical session before stopping, then stop and run systemctl status from tty. Is session-N.scope with that ID still up, or any other stray units?

@LukeXuan
Copy link
Author

LukeXuan commented Feb 7, 2025

I just tried, $XDG_SESSION_ID was 4, and after logout attempt and checking systemctl status in tty, session-4.scope did disappear.

● luke-desktop
    State: running
    Units: 596 loaded (incl. loaded aliases)
     Jobs: 0 queued
   Failed: 0 units
    Since: Fri 2025-02-07 09:51:25 EST; 5h 56min ago
  systemd: 256.11-1.fc41
  Tainted: local-hwclock
   CGroup: /
           ├─init.scope
           │ └─1 /usr/lib/systemd/systemd --switched-root --system --deserialize=51 rhgb
           ├─system.slice
           │ ├─ModemManager.service
           │ │ └─1497 /usr/sbin/ModemManager
           │ ├─NetworkManager.service
           │ │ └─1514 /usr/sbin/NetworkManager --no-daemon
           │ ├─abrt-journal-core.service
           │ │ └─1627 /usr/bin/abrt-dump-journal-core -D -T -f -e
           │ ├─abrt-oops.service
           │ │ └─1628 /usr/bin/abrt-dump-journal-oops -fxtD
           │ ├─abrt-xorg.service
           │ │ └─1629 /usr/bin/abrt-dump-journal-xorg -fxtD
           │ ├─abrtd.service
           │ │ └─1500 /usr/sbin/abrtd -d -s
           │ ├─alsa-state.service
           │ │ └─1449 /usr/sbin/alsactl -s -n 19 -c -E ALSA_CONFIG_PATH=/etc/alsa/alsactl.conf --initfile=/lib/alsa/init/00main rdaemon
           │ ├─atd.service
           │ │ └─1736 /usr/sbin/atd -f
           │ ├─auditd.service
           │ │ ├─1366 /usr/sbin/auditd
           │ │ └─1369 /usr/sbin/sedispatch
           │ ├─avahi-daemon.service
           │ │ ├─1398 "avahi-daemon: running [luke-desktop.local]"
           │ │ └─1430 "avahi-daemon: chroot helper"
           │ ├─bluetooth.service
           │ │ └─1399 /usr/libexec/bluetooth/bluetoothd
           │ ├─chronyd.service
           │ │ └─1453 /usr/sbin/chronyd -F 2
           │ ├─coolercontrold.service
           │ │ └─1582 /usr/bin/coolercontrold
           │ ├─crond.service
           │ │ └─1737 /usr/sbin/crond -n
           │ ├─dbus-broker.service
           │ │ ├─1395 /usr/bin/dbus-broker-launch --scope system --audit
           │ │ └─1396 dbus-broker --log 4 --controller 9 --machine-id 6e66fcb7db4245908578973985d4644a --max-bytes 536870912 --max-fds 4096 --max-matches 131072 --audit
           │ ├─firewalld.service
           │ │ └─1498 /usr/bin/python3 -sP /usr/sbin/firewalld --nofork --nopid
           │ ├─fprintd.service
           │ │ └─9089 /usr/libexec/fprintd
           │ ├─gpm.service
           │ │ └─1450 gpm -m /dev/input/mice -t exps2
           │ ├─gssproxy.service
           │ │ └─1594 /usr/sbin/gssproxy -i
           │ ├─irqbalance.service
           │ │ └─1410 /usr/sbin/irqbalance
           │ ├─libvirtd.service
           │ │ ├─1840 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/libexec/libvirt_leaseshelper
           │ │ └─1842 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/libexec/libvirt_leaseshelper
           │ ├─pcscd.service
           │ │ └─3136 /usr/sbin/pcscd --foreground --auto-exit
           │ ├─polkit.service
           │ │ └─1414 /usr/lib/polkit-1/polkitd --no-debug --log-level=err
           │ ├─rsyslog.service
           │ │ └─1415 /usr/sbin/rsyslogd -n
           │ ├─rtkit-daemon.service
           │ │ └─1416 /usr/libexec/rtkit-daemon
           │ ├─sddm.service
           │ │ └─1750 /usr/bin/sddm
           │ ├─smartd.service
           │ │ └─1417 /usr/sbin/smartd -n -q never --capabilities=mail
           │ ├─sshd.service
           │ │ └─1595 "sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups"
           │ ├─switcheroo-control.service
           │ │ └─1418 /usr/libexec/switcheroo-control
           │ ├─system-cups.slice
           │ │ └─cups.service
           │ │   └─1583 /usr/sbin/cupsd -l
           │ ├─system-dbus\x2d:1.3\x2dorg.freedesktop.problems.slice
           │ │ └─dbus-:[email protected]
           │ │   └─2824 /usr/sbin/abrt-dbus -t133
           │ ├─system-getty.slice
           │ │ └─[email protected]
           │ │   └─2337 /sbin/agetty -o "-p -- \\u" --noclear - linux
           │ ├─systemd-homed.service
           │ │ └─1419 /usr/lib/systemd/systemd-homed
           │ ├─systemd-hostnamed.service
           │ │ └─9102 /usr/lib/systemd/systemd-hostnamed
           │ ├─systemd-journald.service
           │ │ └─995 /usr/lib/systemd/systemd-journald
           │ ├─systemd-logind.service
           │ │ └─1420 /usr/lib/systemd/systemd-logind
           │ ├─systemd-machined.service
           │ │ └─1421 /usr/lib/systemd/systemd-machined
           │ ├─systemd-oomd.service
           │ │ └─1364 /usr/lib/systemd/systemd-oomd
           │ ├─systemd-resolved.service
           │ │ └─1365 /usr/lib/systemd/systemd-resolved
           │ ├─systemd-udevd.service
           │ │ └─udev
           │ │   └─1046 /usr/lib/systemd/systemd-udevd
           │ ├─systemd-userdbd.service
           │ │ ├─1032 /usr/lib/systemd/systemd-userdbd
           │ │ ├─8523 "systemd-userwork: waiting..."
           │ │ ├─8524 "systemd-userwork: waiting..."
           │ │ └─8525 "systemd-userwork: waiting..."
           │ ├─udisks2.service
           │ │ └─1422 /usr/libexec/udisks2/udisksd
           │ ├─upower.service
           │ │ └─1423 /usr/libexec/upowerd
           │ └─wpa_supplicant.service
           │   └─1639 /usr/sbin/wpa_supplicant -c /etc/wpa_supplicant/wpa_supplicant.conf -u -s
           └─user.slice
             └─user-1000.slice
               ├─session-6.scope
               │ ├─9076 "login -- luke"
               │ ├─9099 -zsh
               │ └─9191 systemctl status
               └─[email protected]
                 ├─app.slice
                 │ ├─app-dbus\x2d:1.31\x2dorg.a11y.atspi.Registry.slice
                 │ │ └─dbus-:[email protected]
                 │ │   └─2847 /usr/libexec/at-spi2-registryd --use-gnome-session
                 │ ├─dconf.service
                 │ │ └─2666 /usr/libexec/dconf-service
                 │ ├─emacs.service
                 │ │ └─2504 /home/luke/Builds/emacs/bin/emacs --fg-daemon
                 │ └─obex.service
                 │   └─2926 /usr/libexec/bluetooth/obexd
                 ├─init.scope
                 │ ├─2485 /usr/lib/systemd/systemd --user
                 │ └─2487 "(sd-pam)"
                 └─session.slice
                   ├─dbus-broker.service
                   │ ├─2533 /usr/bin/dbus-broker-launch --scope user
                   │ └─2534 dbus-broker --log 4 --controller 10 --machine-id 6e66fcb7db4245908578973985d4644a --max-bytes 100000000000000 --max-fds 25000000000000 --max-matches 5000000000
                   ├─pipewire-pulse.service
                   │ └─2903 /usr/bin/pipewire-pulse
                   ├─pipewire.service
                   │ └─2856 /usr/bin/pipewire
                   └─wireplumber.service
                     └─2857 /usr/bin/wireplumber

I also checked for shutdown events of [email protected] in journalctl,

Feb 07 15:47:54 luke-desktop systemd[2485]: [email protected]: Main process exited, code=dumped, status=11/SEGV
Feb 07 15:47:54 luke-desktop systemd[2485]: [email protected]: Failed with result 'core-dump'.
Feb 07 15:47:54 luke-desktop systemd[2485]: Stopped [email protected] - Main service for Hyprland, An intelligent dynamic tiling Wayland compositor.
Feb 07 15:47:54 luke-desktop systemd[2485]: [email protected]: Triggering OnFailure= dependencies.
Feb 07 15:47:54 luke-desktop systemd[2485]: [email protected]: Consumed 2min 12.671s CPU time, 976.7M memory peak.
Feb 07 15:47:54 luke-desktop systemd[2485]: Stopped target graphical-session-pre.target - Session services which should run early before the graphical session is brought up.
Feb 07 15:47:54 luke-desktop systemd[2485]: Stopped target [email protected] - Preparation for session of hyprland.desktop Wayland compositor.
Feb 07 15:47:54 luke-desktop systemd[2485]: Stopping [email protected] - Bind graphical session to PID 2505...
Feb 07 15:47:54 luke-desktop sddm-helper[2459]: pam_unix(sddm:session): session closed for user luke
Feb 07 15:47:54 luke-desktop audit[2459]: USER_END pid=2459 uid=0 auid=1000 ses=4 subj=system_u:system_r:xdm_t:s0-s0:c0.c1023 msg='op=PAM:session_close grantors=pam_selinux,pam_loginuid,pam_selinux,pam_keyinit,pam_namesp>
Feb 07 15:47:54 luke-desktop audit[2459]: CRED_DISP pid=2459 uid=0 auid=1000 ses=4 subj=system_u:system_r:xdm_t:s0-s0:c0.c1023 msg='op=PAM:setcred grantors=pam_unix acct="luke" exe="/usr/libexec/sddm-helper" hostname=luk>
Feb 07 15:47:54 luke-desktop systemd[2485]: Stopping [email protected] - Environment preloader for Hyprland, An intelligent dynamic tiling Wayland compositor...
Feb 07 15:47:54 luke-desktop systemd[2485]: Stopped [email protected] - Bind graphical session to PID 2505.
Feb 07 15:47:54 luke-desktop systemd[2485]: [email protected]: Triggering OnSuccess= dependencies.
Feb 07 15:47:54 luke-desktop sddm[1750]: Auth: sddm-helper exited with 1
Feb 07 15:47:54 luke-desktop abrt-server[8995]: eu-unstrip: No modules recognized in core file
Feb 07 15:47:54 luke-desktop systemd[1]: session-4.scope: Deactivated successfully.
Feb 07 15:47:54 luke-desktop systemd-logind[1420]: Session 4 logged out. Waiting for processes to exit.
Feb 07 15:47:54 luke-desktop systemd-logind[1420]: Removed session 4.

To my untrained eye this looks normal except Triggering OnFailure= dependencies, but I don't think that will affect sddm's behavior? I assume sddm only interface with wayland-session-bindpid@*.service.

@Vladimir-csp
Copy link
Owner

I may be wrong, but sddm should only care for the processes it starts, or a session scope at most. Maybe a zombie process from that scope was left behind? (systemctl status does not show zombies)

@LukeXuan
Copy link
Author

LukeXuan commented Feb 7, 2025

I tried to systemctl status session-4.scope and it says cannot find such a scope. Is there a ps argument that shows zombie of a session or some other arguments to systemctl satus?

@Vladimir-csp
Copy link
Owner

You can note PIDs from the session scope while it is alive, then check them with ps after stop.

@LukeXuan
Copy link
Author

LukeXuan commented Feb 7, 2025

I will give it a try tomorrow.

@LukeXuan
Copy link
Author

LukeXuan commented Feb 8, 2025

Before uwsm stop, this is what systemctl status session-2.scope shows:

● session-2.scope - Session 2 of User luke
     Loaded: loaded (/run/systemd/transient/session-2.scope; transient)
  Transient: yes
     Active: active (running) since Sat 2025-02-08 17:51:31 EST; 52s ago
 Invocation: a299bdb57a5e4bcca90cdea8cc024f2e
      Tasks: 3
     Memory: 4M (peak: 19.3M)
        CPU: 90ms
     CGroup: /user.slice/user-1000.slice/session-2.scope
             ├─1949 /usr/libexec/sddm-helper --socket /tmp/sddm-auth-f6dda662-8431-4c60-b3ff-df4d61c41a14 --id 1 --start "uwsm start -- hyprland.desktop" --user luke
             ├─2002 systemctl --user start --wait [email protected]
             └─2046 waitpid -e 2108

Feb 08 17:51:31 luke-desktop systemd[1]: Started session-2.scope - Session 2 of User luke.

I don't know if this is expected (I didn't open anything else, just a terminal), but none of the pids show up in ps aux.

@glebzlat
Copy link

glebzlat commented Feb 16, 2025

It seems I have similar problem with SDDM on Fedora. When I execute uwsm stop, I end up with a black screen with blinking cursor.

In my case logs look weird.

Feb 16 13:48:40 fedora session.sh[33371]: Terminated
Feb 16 13:48:43 fedora wpa_supplicant[1415]: wlo1: CTRL-EVENT-SIGNAL-CHANGE above=1 signal=-30 noise=9999 txrate=585000
Feb 16 13:48:45 fedora systemd[1]: pcscd.service: Deactivated successfully.
Feb 16 13:48:45 fedora audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=pcscd comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Feb 16 13:48:46 fedora wpa_supplicant[1415]: wlo1: CTRL-EVENT-SIGNAL-CHANGE above=1 signal=-30 noise=9999 txrate=585000
Feb 16 13:48:49 fedora wpa_supplicant[1415]: wlo1: CTRL-EVENT-SIGNAL-CHANGE above=1 signal=-30 noise=9999 txrate=585000
Feb 16 13:48:51 fedora systemd[31838]: wayland-wm@start\x2dsway.service: State 'final-sigterm' timed out. Aborting.
Feb 16 13:48:51 fedora audit[33371]: ANOM_ABEND auid=1000 uid=1000 gid=1000 ses=32 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 pid=33371 comm="session.sh" exe="/usr/bin/bash" sig=6 res=1
Feb 16 13:48:51 fedora audit[33582]: ANOM_ABEND auid=1000 uid=1000 gid=1000 ses=32 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 pid=33582 comm="systemctl" exe="/usr/bin/systemctl" sig=6 res=1
Feb 16 13:48:51 fedora systemd[31838]: wayland-wm@start\x2dsway.service: Killing process 33371 (session.sh) with signal SIGABRT.
Feb 16 13:48:51 fedora systemd[31838]: wayland-wm@start\x2dsway.service: Killing process 33582 (systemctl) with signal SIGABRT.
Feb 16 13:48:51 fedora systemd-coredump[33586]: Process 33371 (session.sh) of user 1000 terminated abnormally with signal 6/ABRT, processing...
Feb 16 13:48:51 fedora systemd-coredump[33587]: Process 33582 (systemctl) of user 1000 terminated abnormally with signal 6/ABRT, processing...
Feb 16 13:48:51 fedora audit: BPF prog-id=484 op=LOAD
Feb 16 13:48:51 fedora audit: BPF prog-id=485 op=LOAD
Feb 16 13:48:51 fedora audit: BPF prog-id=486 op=LOAD
Feb 16 13:48:51 fedora audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-coredump@8-33586-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Feb 16 13:48:51 fedora systemd[1]: Started [email protected] - Process Core Dump (PID 33586/UID 0).
Feb 16 13:48:51 fedora audit: BPF prog-id=487 op=LOAD
Feb 16 13:48:51 fedora audit: BPF prog-id=488 op=LOAD
Feb 16 13:48:51 fedora audit: BPF prog-id=489 op=LOAD
Feb 16 13:48:51 fedora systemd[1]: Started [email protected] - Process Core Dump (PID 33587/UID 0).

There are two core dumps from session.sh and systemctl, then

Feb 16 13:48:51 fedora systemd[31838]: wayland-wm@start\x2dsway.service: Failed with result 'timeout'.
Feb 16 13:48:51 fedora audit[33220]: USER_END pid=33220 uid=0 auid=1000 ses=37 subj=system_u:system_r:xdm_t:s0-s0:c0.c1023 msg='op=PAM:session_close grantors=pam_selinux,pam_loginuid,pam_selinux,pam_keyinit,pam_namespace,pam_keyinit,pam_limits,pam_systemd,pam_unix,pam_umask,pam_lastlog acct="gleb" exe="/usr/libexec/sddm-helper" hostname=fedora addr=? terminal=/dev/tty3 res=success'
Feb 16 13:48:51 fedora audit[33220]: CRED_DISP pid=33220 uid=0 auid=1000 ses=37 subj=system_u:system_r:xdm_t:s0-s0:c0.c1023 msg='op=PAM:setcred grantors=pam_localuser,pam_unix acct="gleb" exe="/usr/libexec/sddm-helper" hostname=fedora addr=? terminal=/dev/tty3 res=success'
Feb 16 13:48:51 fedora systemd[1]: [email protected]: Deactivated successfully.
Feb 16 13:48:51 fedora sddm-helper[33220]: pam_unix(sddm:session): session closed for user gleb
Feb 16 13:48:51 fedora systemd[31838]: Stopped wayland-wm@start\x2dsway.service - Main service for sway.
Feb 16 13:48:51 fedora systemd[31838]: wayland-wm@start\x2dsway.service: Triggering OnFailure= dependencies.
Feb 16 13:48:51 fedora systemd[31838]: wayland-wm@start\x2dsway.service: Consumed 691ms CPU time, 139.5M memory peak.
Feb 16 13:48:51 fedora systemd[31838]: Stopped target graphical-session-pre.target - Session services which should run early before the graphical session is brought up.
Feb 16 13:48:51 fedora systemd[31838]: Reached target sway-session-shutdown.target - Shutdown running Sway session.
Feb 16 13:48:51 fedora systemd[31838]: Stopped target wayland-session-pre@start\x2dsway.target - Preparation for session of start-sway Wayland compositor.
Feb 16 13:48:51 fedora systemd[31838]: Stopping [email protected] - Bind graphical session to PID 33233...
Feb 16 13:48:51 fedora systemd[31838]: Stopping wayland-wm-env@start\x2dsway.service - Environment preloader for sway...
Feb 16 13:48:51 fedora systemd[31838]: Stopped [email protected] - Bind graphical session to PID 33233.
Feb 16 13:48:51 fedora systemd[31838]: [email protected]: Triggering OnSuccess= dependencies.
Feb 16 13:48:51 fedora systemd[31838]: Stopped target sway-session-shutdown.target - Shutdown running Sway session.
Feb 16 13:48:51 fedora systemd[1]: session-37.scope: Deactivated successfully.
Feb 16 13:48:51 fedora sddm[33130]: Auth: sddm-helper exited with 1
Feb 16 13:48:51 fedora systemd-logind[1166]: Session 37 logged out. Waiting for processes to exit.
Feb 16 13:48:51 fedora systemd-logind[1166]: Removed session 37.

Versions:

  • sway: sway version 1.10.1
  • system: fedora 6.12.11-200.fc41.x86_64
  • sddm: 0.21.0

@Vladimir-csp
Copy link
Owner

Installed sddm and reproduced it.
This may be a general sddm wayland mode issue sddm/sddm#1984
Although disabling and stopping [email protected] does not fix anything.

@glebzlat
Copy link

Tried to disable [email protected]. uwsm stop threw me to the black screen with the cursor, and when I entered Ctrl+C, SDDM launched. But when I did this for the second time, everything froze - I couldn't even access other TTYs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants