Skip to main content
Topic: [WIP] seatd support (elogind alternative) (Read 16137 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: [WIP] seatd support (elogind alternative)

Reply #45
I installed seatd on 2 machines and sadly had to revert back.
I had the same NetworkManager issue as replabrobin #41, couldn't connect or disconnect even thought I was on the required groups the BTW wiki (Archwiki) to the rescue https://wiki.archlinux.org/title/NetworkManager#Set_up_PolicyKit_permissions
Code: [Select]
doas bash -c " echo -e 'polkit.addRule(function(action, subject) {
  if (action.id.indexOf("org.freedesktop.NetworkManager.") == 0 && subject.isInGroup("network")) {
    return polkit.Result.YES;
  }
});' >> /etc/polkit-1/rules.d/50-org.freedesktop.NetworkManager.rules"
instantly fixed it.
What stopped working was Plasma on Wayland although Enlightenment seemed to work fine and Firefox wasn't able anymore to read u2f keys like the Google Titan.
I reverted back on bare metal but I'm setting up a vm to keep testing it. Things like opendoas seatd or toybox have a special place on my heart because they don't load 30 or 40 years of legacy on to my cpu!

Re: [WIP] seatd support (elogind alternative)

Reply #46
Hello!
 I have been using S6- XFCE. Just removed Elogind, but I can't restart or shutdown anymore.
 I can login into XFCE, but restart and shutdown has been greyed out.
 Added user to groups -wheel, audio, video, storage, input, disk.
 Thank you.

Re: [WIP] seatd support (elogind alternative)

Reply #47
Hello!
 I have been using S6- XFCE. Just removed Elogind, but I can't restart or shutdown anymore.
 I can login into XFCE, but restart and shutdown has been greyed out.
 Added user to groups -wheel, audio, video, storage, input, disk.
 Thank you.
Most likely GUI methods for restart/shutdown internally rely on (e)logind commands like loginctl poweroff
ARMtix

Re: [WIP] seatd support (elogind alternative)

Reply #48
Most likely GUI methods for restart/shutdown internally rely on (e)logind commands like loginctl poweroff
This can be easily fixed by creating a script /usr/bin/loginctl (or /usr/bin/systemctl) with logic to parse loginctl's arguments and call /usr/bin/shutdown or init-specific programs to handle shutdown/reboot directly.

Update: A quick 66 demonstration:
Code: [Select]
#!/bin/sh

show_usage()
{
cat <<EOT
Usage: ${0##*/} [halt|reboot|poweroff]
EOT
}

case $1 in
halt) 66-hpr -h;;
reboot) 66-hpr -r;;
poweroff) 66-hpr -p;;
*) show_usage
esac

Re: [WIP] seatd support (elogind alternative)

Reply #49
Hello!
 I have been using S6- XFCE. Just removed Elogind, but I can't restart or shutdown anymore.
 I can login into XFCE, but restart and shutdown has been greyed out.
 Added user to groups -wheel, audio, video, storage, input, disk.
 Thank you.
This should be because polkit doesn't support seatd/seatd doesn't support polkit, I made a post about it in this thread. Aside from the shutdown/reboot buttons being greyed out, anything that needs elevated privileges (mounting/unmounting from file manager if you're not in the storage group, gparted, timeshift, etc) won't work unless you do it in a terminal.

Re: [WIP] seatd support (elogind alternative)

Reply #50
Also to note is that other packages like xorg-server will pull in elogind again. I had to add that to IgnorePkg in /etc/pacman.conf. And a full system upgrade is done by:

Code: [Select]
pacman -Syudd

after checking that is the only dependency check not allowing a normal upgrade to go forward. Ignoring packages is not supported by Artix developers, so do so at your own risk. However, without doing so will allow elogind to be installed again.

Re: [WIP] seatd support (elogind alternative)

Reply #51
Hello!
 I have been using S6- XFCE. Just removed Elogind, but I can't restart or shutdown anymore.
 I can login into XFCE, but restart and shutdown has been greyed out.
 Added user to groups -wheel, audio, video, storage, input, disk.
 Thank you.

I'm not sure if you have configuration options to configure the commands that respond to gui interactions (or if this would affect the gui UX at all), but in the terminal I had to write a super server to handle reboot/shutdown without using doas since the execline scripts wrap a binary owned by root /bin/reboot. If you did the same and configure the buttons with event handlers for your commands, it might be something that allows the interaction?

Code: [Select]
# /etc/s6/adminsv/hpr-srv/run
#!/usr/bin/env -S execlineb -P

s6-ipcserver /run/hpr
s6-ipcserver-access -i data/rules
s6-sudod s6-linux-init-hpr

Then under the service dir: data/rules/uid/1000/allow to allow uid 1000 to send privleged commands to the root binary for hpr operations provided by s6-linux-init-hpr binary.

An accompanying bash script to speak to the super server throught the socket:

e.g. $HOME/.local/bin/reboot
Code: [Select]
#!/usr/bin/env bash

s6-sudo /run/hpr -r

Now  you might be able to configure your gui to use the script. I don't know how any of those gui mechanisms work, but thought I might throw out an idea based on my experience of what I had to do to after switching to seatd for feature parity with what elogind was providing.

Re: [WIP] seatd support (elogind alternative)

Reply #52
For those that use pipewire, wireplumber does not work with seatd. You have to either use elogind (instead of seatd) or pipewire-media-session (instead of wireplumber).

Re: [WIP] seatd support (elogind alternative)

Reply #53
For those that use pipewire, wireplumber does not work with seatd. You have to either use elogind (instead of seatd) or pipewire-media-session (instead of wireplumber).

That’s only because Artix compiles Wireplumber without “-Delogind=disabled” as an argument:

https://gitea.artixlinux.org/packagesW/wireplumber/src/branch/master/x86_64/extra/PKGBUILD

And compiling wireplumber with said argument does in fact make it useable with seatd, though it apparently affects Bluetooth-usage:

https://gitlab.freedesktop.org/pipewire/wireplumber/-/issues/208

But I haven’t tested that, since I don’t use Bluetooth - and even then it seems a minor inconvenience, since I suspect that most would start pipewire on their own :)

Re: [WIP] seatd support (elogind alternative)

Reply #54
Wow!

Thank you guys for this work! Im glad im found this.

elogind was the last pain wich had to be to removed  :)

Everything works so far perfectly (openrc).

The only thing, i cant shutdown/reboot over GUI (KDE) anymore. sudo shutdown or sudo reboot works.

Sadly, i dont quite understand this and how to implement this for openrc: https://forum.artixlinux.org/index.php/topic,3050.msg23032.html#msg23032

Edit:

Edit: and i found out that i cant install ungoogled-chromium so simple anymore, because it has a depency on systemd (i think elogind delivered this depency before?). Is there a easy way to fake it?

I installed it now with pacman -Sdd ungoogled-chromium. But i think there could now be missing some missing depencys because with that command i skipped the check. So far it started normaly anyway.


found out that this fix this: https://artixlinux.org/news.php#artix-archlinux-support_moves_to_%5Buniverse%5D

Edit2: After 10 hours more fiddeling... so far everything works. except like mentioned the shutdown/reboot over gui, and programms cant ask for root password (kate for example to save something under /etc/X11/ for example). Or grub-customizer.

Already found out, that this is possible a problem with polkit, because following error i get:


Code: [Select]
[user@polis ~]$ /usr/lib/polkit-kde-authentication-agent-1
New PolkitAgentListener  0x560214096800
Adding new listener  PolkitQt1::Agent::Listener(0x5602140c0fd0) for  0x560214096800
Listener online
"Cannot register authentication agent: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Cannot determine user of subject"
Authentication agent result: false
Couldn't register listener!
[user@polis ~]$

Code: [Select]
[user@polis ~]$ grub-customizer 
localuser:root being added to access control list
==== AUTHENTICATING FOR net.launchpad.danielrichter2007.pkexec.grub-customizer ====
Authentication is required to run Grub Customizer
Authenticating as: user
Password:
polkit-agent-helper-1: error response to PolicyKit daemon: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: No session for cookie
==== AUTHENTICATION FAILED ====
Error executing command as another user: Not authorized

This incident has been reported.
localuser:root being removed from access control list
[user@polis ~]$

The Text translated from the Picture:

The document cannot be saved because writing to /test is not possible.
Please check if you have write permissions for the file and if there is enough space. The original file may be deleted or damaged. Do not exit the program until the file has been written successfully.



Edit: This just fixed somehow self, after i installed today virt-manager, qemu etc and tutanota (and for tutanota gnome-keyring) and a update with pacman -Syu.

Re: [WIP] seatd support (elogind alternative)

Reply #55
seatd works on dinit?

I was greeted with a login prompt from tty after doing these steps from the op.  But I had did it in a terminal in mate from gui and it didn't crash mate.

Lightdm I started manually but won't let me login...

I can login as root though.   Strange.  Root but not user.

Is there a group for open console or xorg my user might need? 

 Xf86OpenConsole can not open virtual console 7 permission denied

The ~/.local/share/xorg/Xorg.0.log seems to repeat the same error but offers no new insights.  pastebin nonetheless  https://pastebin.com/Yaqpvf3M

I installed xfce4 from tty after rebooting to bypass lightdm and see what startxfce4 would throw at me

Can only login as root to reach a gui.  Please advise.

should i thus install xf86-input-evdev?

some of this looks relevant possibly...  https://unix.stackexchange.com/questions/497204/cannot-open-virtual-console-7-permission-denied-when-trying-to-start-x-on-gent

Quote
i7-7700:[root]:~/Desktop# dinitctl enable seatd
dinitctl: service already enabled.
i7-7700:[root]:~/Desktop# dinitctl start seatd
Service 'seatd' failed to start.
i7-7700:[root]:~/Desktop#


Everyone likely gone to bed in Europe by now...


Switching back to elogind I am not greeted with a command prompt but lightdm no longer allows autologin

removing pam_rundir restored autologin under elogind so i conclude pam_rundir is the problem i was having with xf86OpenConsole permissions issue?  And also the issue with why i couldn't login except through root to the gui.

back on elogind for now.
Cat Herders of Linux

Re: [WIP] seatd support (elogind alternative)

Reply #56
tried it one more time

Quote
sudo dinitctl enable seatd
Service 'seatd' has been enabled.
Service 'seatd' failed to start.
clealry this is the failing step.  i had added my user to seat and created seatd and added it to that also but that was of no avail and since you say seat is all that's required i deleted the seatd group after all.  either way it's no dice.
Cat Herders of Linux

Re: [WIP] seatd support (elogind alternative)

Reply #57
I have now found a way to shutdown/reboot convenient.

Atleast on KDE. On KDE i had everytime this Addon: https://www.pling.com/p/1288430 (dont know why https://store.kde.org redirects to pling if you search for something).

This worked for me, because i dont use KDEs Applauncher (im using instead rofi) and had mentioned addon added to my topbar.

Now i found this addon: https://www.pling.com/p/1297839

This allows to run a custom script or command.

So i installed zenity, and wrote following Script:

Code: [Select]
#!/bin/sh

var=$(zenity --width=300 --height=220 --list --radiolist --text="" --title="System" --column "Auswahl" --column "Aktion" False Herrunterfahren TRUE Neustart)

if [ -n "${var}" ];then
  case $var in
  Herrunterfahren)
    sudo poweroff
    ;;
  Neustart)
    sudo reboot
    ;;
  esac
fi

Added poweroff and reboot to sudoers file.

And edited my Button to run this script.

Now it looks like attached.




Re: [WIP] seatd support (elogind alternative)

Reply #58
Also to note is that other packages like xorg-server will pull in elogind again. I had to add that to IgnorePkg in /etc/pacman.conf. And a full system upgrade is done by:

Code: [Select]
pacman -Syudd

after checking that is the only dependency check not allowing a normal upgrade to go forward. Ignoring packages is not supported by Artix developers, so do so at your own risk. However, without doing so will allow elogind to be installed again.

If you hold back elogind and were using pipewire-media-session, recent updates may have switched you to wireplumber. e.g pipewire-pulse for bluetooth audio. To switch to using wireplumber, first write a service to start it as a user service when logging in, then configure wireplumber to not use logind.

Code: [Select]
mkdir -p ~/.config/wireplumber/bluetooth.lua.d
cp /usr/share/wireplumber/bluetooth.lua.d/50-bluez-config.lua ~/.config/wireplumber/bluetooth.lua.d/

# set default true to false within lua file
["with-logind"] = false

This will allow you to start wireplumber without a logind on your system.

Ref: https://gitlab.freedesktop.org/pipewire/wireplumber/-/issues/208

Re: [WIP] seatd support (elogind alternative)

Reply #59
If you hold back elogind and were using pipewire-media-session, recent updates may have switched you to wireplumber. e.g pipewire-pulse for bluetooth audio. To switch to using wireplumber, first write a service to start it as a user service when logging in, then configure wireplumber to not use logind.

Code: [Select]
mkdir -p ~/.config/wireplumber/bluetooth.lua.d
cp /usr/share/wireplumber/bluetooth.lua.d/50-bluez-config.lua ~/.config/wireplumber/bluetooth.lua.d/

# set default true to false within lua file
["with-logind"] = false

This will allow you to start wireplumber without a logind on your system.

Ref: https://gitlab.freedesktop.org/pipewire/wireplumber/-/issues/208

Thanks a lot! With this I could finally try seatd with bluetooth. It works :D.
Artix Linux Colombia