Skip to main content
Topic: [SOLVED] No Suspend/Reboot/Shutdown access in sddm (Read 835 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[SOLVED] No Suspend/Reboot/Shutdown access in sddm

I just did a fresh install of artix with dinit, I have sddm working but for some reason the Suspend/Reboot/Shutdown buttons are unresponsive on some themes like the artix one and greyed out on others (or perhaps that's how they're supposed to look in the theme, I can't remember).

I'm not sure what I did differently this install, other than previously I had installed gdm before switching to sddm so maybe there's a gdm dependency that was helping me before that isn't there now.

I tested 'loginctl reboot' in a terminal and that works fine.

Any idea what could be preventing sddm from having this functionality?  Something pam related?  I did google around, but found mostly systemd-referencing things...

I did find this: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=270835

So I just tried some things, and I installed consolekit and polkit-consolekit from the aur, which removed my polkit package.

This caused sddm to not start properly, although I could do a sudo dinitctl restart sddm to bring it up.  My buttons were no longer greyed out but when I tried to log in it just booted me back to sddm.

Sorry for my lack of understanding of what's going on here.  It just worked on my last install.

Re: No Suspend/Reboot/Shutdown access in sddm

Reply #1
Update:

I did more experimenting it turns out if I restart sddm (sudo dinitctl restart sddm) then the buttons are functional.

So this is some kind of a "it's starting too soon" error?  Maybe elogind related?

This is the sddm-dinit script that artix has in it's repositories:

Code: [Select]
type            = process
command         = /usr/bin/sddm
smooth-recovery = true
depends-on      = logind
depends-on      = sddm-pre
after           = loginready
waits-for.d     = live.d

And it worked fine on my last install, I'm at a loss...

Re: No Suspend/Reboot/Shutdown access in sddm

Reply #2
sddm buttons working here, tested with artix theme and breeze..
also using dinit, wouldn't think it relevant.
a bsd bug report won't be much help either.
maybe take a look at /var/log/sddm.log for some error/warning
and output of `sudo dinitctl list | grep pid`

Re: No Suspend/Reboot/Shutdown access in sddm

Reply #3
No warnings/errors in the logs on startup, but these warnings on shutdown:
Code: [Select]
[01:52:55.078] (WW) HELPER: Signal received: SIGTERM
[01:52:55.078] (WW) DAEMON: Signal received: SIGTERM
[01:52:55.740] (II) HELPER: [PAM] Closing session
[01:52:55.741] (WW) HELPER: [PAM] closeSession: Error in service module
[01:52:55.743] (II) HELPER: [PAM] Ended.
[01:52:55.744] (WW) DAEMON: Auth: sddm-helper exited with 255

Output of 'sudo dinitctl list | grep pid'
Code: [Select]
[{+}     ] udevd (pid: 526)
[{+}     ] sddm (pid: 614)
[{+}     ] elogind (pid: 613)
[{+}     ] dbus (pid: 602)
[{+}     ] dhcpcd (pid: 584)
[{+}     ] bluetoothd (pid: 612)
[{+}     ] turnstiled (pid: 583)
[{+}     ] iwd (pid: 610)
[{+}     ] tty1 (pid: 691)
[{+}     ] tty2 (pid: 692)
[{+}     ] tty3 (pid: 693)
[{+}     ] tty4 (pid: 694)
[{+}     ] tty5 (pid: 695)
[{+}     ] tty6 (pid: 696)

Re: No Suspend/Reboot/Shutdown access in sddm

Reply #4
Not sure what I did differently, but after formatting/reinstalling everything is functioning properly.

I think what I did differently was instead of installing the pambase-turnstile package, I just added '-session   optional   pam_turnstile.so' to /etc/pam.d/system-login manually.  There is a warning when installing pambase-turnstile that it may not be up-to-date with pambase so maybe maybe maybe that was it.  Not sure.

Re: [SOLVED] No Suspend/Reboot/Shutdown access in sddm

Reply #5
i wondered about turnstyle since i don't have that, but i didn't have a basis for why..
looking at the package sources on gitea, that all looks in order, i can see only that one line you add difference between the two packages..

Re: [SOLVED] No Suspend/Reboot/Shutdown access in sddm

Reply #6
I am on a similar setup to yours and indeed even when the dummy elogind process allows gui shutdown/reboot on unsupported desktops, in sddm it doesn't work. The tldr it would seem that sddm likes doing it's own thing nowadays kind of like it's gnome counterpart.
Have turnstile just on /etc/pam.d/system-login but also have the package pambase-turnstile installed, out of curiosity if i don't finally switch to greetd on wayland any time soon i will try to replace with regular pambase and just add that line.

Re: [SOLVED] No Suspend/Reboot/Shutdown access in sddm

Reply #7
Yeah I don't understand it.  I've done another reinstall, this time I've abandoned wayland but stuck with sddm into xfce.  I did the same thing when installing turnstile (manually adding the line for pam, rather than installing the turnstile pambase package) and now the buttons are greyed out again.

Re: [SOLVED] No Suspend/Reboot/Shutdown access in sddm

Reply #8
If restarting sddm helps and it might be a race condition then you could try adding a "sleep 5" or some other suitable number as a delay before it starts in the boot process somehow. If that worked then presumably the proper solution would be that the init script should depend on the needed process as delays are a kludge not a fix, but a kludge can be a help for a start.

Re: [SOLVED] No Suspend/Reboot/Shutdown access in sddm

Reply #9
Hm I'm having trouble getting a delay in there...

Last thing I tried was creating a service file called "wait5":
Code: [Select]
type	= process
command = /usr/bin/sleep 5
chain-to = sddm
depends-on = logind
after = loginready
waits-for.d = live.d
restart = no
options = always-chain

I thought the chain-to would do it, but no luck.  Added restart = no and options = always-chain after that.  I also tried it as type = scripted.  Not sure why it won't trigger (chain) into sddm.

Re: [SOLVED] No Suspend/Reboot/Shutdown access in sddm

Reply #10
I'm not using dinit to try it myself, and the exact workings of inits at boot can be difficult to understand without a lot of study, so others in this thread might be able to offer better advice, but perhaps putting "" quotes around /usr/bin/sleep 5 would help because of the whitespace, or the line in the sddm file might be changed to "/usr/bin/sleep 5 && /usr/bin/sddm" or you could make a bash script called delayed-sddm or whatever, like:
Code: [Select]
#! /bin/bash
/usr/bin/sleep 5
/usr/bin/sddm

and put it somewhere like /usr/local/bin, make it executable then change the command in the sddm file temporarily to point to that?

Re: [SOLVED] No Suspend/Reboot/Shutdown access in sddm

Reply #11
Ah jeez.  I tried that method first and it wasn't working but I just copied your text and it works :P

I didn't have the "#! /bin/bash" line in my first attempt, I guess that's more important than I thought (newbie mistake).

So it works with simply "sleep 1" which is a nice little workaround for the issue.

It would be nice to figure out what needs to be loaded before sddm and edit the dinit service file though.

Re: [SOLVED] No Suspend/Reboot/Shutdown access in sddm

Reply #12
all i can think of is you don't have many services starting and if pids are anything to go by, sddm is starting immediately after elogind, not giving it enough time (fraction of a second) to get it's shit together completely.
ie. sddm depends elogind being started, not elogind 'being ready' ..i guess
in my case, i've a few more things starting between elogind and sddm thus not having this problem.
maybe :)

Re: [SOLVED] No Suspend/Reboot/Shutdown access in sddm

Reply #13
Apologies for the late reply.

ie. sddm depends elogind being started, not elogind 'being ready' ..i guess

You're right. This is because the service depends on elogind being started, not ready.

I do have a patch ready (since elogind's readiness notification uses sd_notify (i.e. systemd)), but it needs to be tested on both s6 and dinit first and it has to be approved by Artix's elogind package maintainer first (OpenRC and runit shouldn't be affected).
now only the dinit guy in artix