Artix Linux Forum

Artix Linux => Announcements => Topic started by: konimex on 30 May 2024, 07:30:00

Title: [WIP] turnstile support - logind alternative
Post by: konimex on 30 May 2024, 07:30:00
It's been rumbling for some time in various scattered threads. I decided to consolidate this into one thread and announce it.

For some time, Artix has added turnstile on an experimental basis, it (combined with other packages) can't replace elogind on a full-time basis, yet.

What is it?

For more information, see: its GitHub page (https://github.com/chimera-linux/turnstile)

And what about seatd?
turnstile itself is not (and will never be, since logind also handles more things than session tracking) a full-fledged logind replacement, so you'll also need seatd and acpid if you want a true elogind-less setup, and they work quite nicely together.

Can we run it in $init?
Yes. turnstiled is a daemon and can be run in any init you wish. For runit and s6 though you may want to create your own until their maintainers create packages for turnstile.

However, for the user services part, currently it only has support for dinit and runit backends. However, Artix currently has support only for dinit backend, with user services such as dbus, pipewire (including pipewire-pulse), and wireplumber (more services will available under the dinit-user-services group).

So for now, you can have OpenRC/s6/runit as your init and system service manager, but have dinit as your user service manager.

Support status
OpenRC as system init: available, untested
runit as system init: N/A
s6 as system init: N/A
dinit as system init: available, I'm using it daily

runit as user services manager: available, untested
s6 as user services manager: N/A, no backend available
dinit as user services manager: available, I'm using it daily
NOTE: Packaging-wise, only dinit is available as it can be separately installed as dinit-base without conflicting to other inits.

To set your backend, edit /etc/turnstile/turnstiled.conf.

Installation
Please note that support is considered experimental.

See wiki page (https://wiki.artixlinux.org/Main/Turnstile).

Features

Issues

Report any issues regarding Artix turnstile implementation here and do not open an issue directly to turnstile's GitHub page before we can confirm it's a bug.

Enjoy testing, and happy hacking!
Title: Re: [WIP] turnstile support - logind alternative
Post by: kiblaster on 30 May 2024, 18:39:14
System init: dinit.

The problem that I have with turnstile is the DISPLAY variable.
Picom, pasystray and lisgd (for gestures) need it .

So I use a shell script instead that it is launched inside the session.
Title: Re: [WIP] turnstile support - logind alternative
Post by: konimex on 31 May 2024, 04:40:25
Committed a new file (https://gitea.artixlinux.org/artix/dinit-rc/commit/fe86ee00879a0060759765a909d51802c46bf8d2) to /etc/X11/xinit/xinitrc.d so dinit reads $DISPLAY and XAUTHORITY. Your script shouldn't be necessary anymore.
Update your dinit-rc to 0.3.6, or wait until it reaches your mirror.
Title: Re: [WIP] turnstile support - logind alternative
Post by: kiblaster on 31 May 2024, 18:39:04
I updated dinit-rc to 0.3.6 and rebooted.

Picom and pasystray services failed to start with display error.
No lisgd here.

E.g. picom error:
Code: [Select]
[ ... main FATAL ERROR ] Can't open display.


Title: Re: [WIP] turnstile support - logind alternative
Post by: konimex on 01 June 2024, 01:10:10
What's the content of your .xinitrc file?
Title: Re: [WIP] turnstile support - logind alternative
Post by: kiblaster on 01 June 2024, 08:37:27
I do not have it.

I use ~/.config/bspwm/bspwmrc.
Title: Re: [WIP] turnstile support - logind alternative
Post by: konimex on 01 June 2024, 11:32:24
I do not have it.

I use ~/.config/bspwm/bspwmrc.

and how do you start bspwm from login? startx?
Title: Re: [WIP] turnstile support - logind alternative
Post by: Hitman on 01 June 2024, 12:51:16
I use a login manager and gui stuff starts fine now, they work for me, only things that are missing are the rest of the misc. qt variables for instance, they aren't passed even if added in /etc/environment (wondering why, that should override everything right?)
Title: Re: [WIP] turnstile support - logind alternative
Post by: konimex on 01 June 2024, 14:51:18
I use a login manager and gui stuff starts fine now, they work for me, only things that are missing are the rest of the misc. qt variables for instance, they aren't passed even if added in /etc/environment (wondering why, that should override everything right?)

Which variables? Not a Qt user here.
Also, dinit reads it from /etc/dinit/environment according to the manpage (only for system instance though (https://github.com/davmac314/dinit/blob/213d3fb1bff820f9cbe981193ad06c103d787405/src/dinit.cc#L487), since we're talking user instance here, it won't be read).
Title: Re: [WIP] turnstile support - logind alternative
Post by: kiblaster on 01 June 2024, 18:39:32
I do not have it.

I use ~/.config/bspwm/bspwmrc.

and how do you start bspwm from login? startx?
I use tinydm (https://aur.archlinux.org/packages/tinydm).

tinydm-1.1.3-1
tinydm source (https://gitlab.com/postmarketOS/tinydm)

Code: [Select]
pacman -Ql tinydm
tinydm /etc/
tinydm /etc/tinydm.d/
tinydm /etc/tinydm.d/env-wayland.d/
tinydm /etc/tinydm.d/env-x11.d/
Title: Re: [WIP] turnstile support - logind alternative
Post by: konimex on 02 June 2024, 03:34:03


and how do you start bspwm from login? startx?
I use tinydm (https://aur.archlinux.org/packages/tinydm).

tinydm-1.1.3-1
tinydm source (https://gitlab.com/postmarketOS/tinydm)

Code: [Select]
pacman -Ql tinydm
tinydm /etc/
tinydm /etc/tinydm.d/
tinydm /etc/tinydm.d/env-wayland.d/
tinydm /etc/tinydm.d/env-x11.d/

Try to copy /etc/X11/xinit/xinitrc.d/01-dinit-env.sh to /etc/tinydm.d/env-x11.d/.
Title: Re: [WIP] turnstile support - logind alternative
Post by: kiblaster on 02 June 2024, 09:19:23
It did not work.
Title: Re: [WIP] turnstile support - logind alternative
Post by: konimex on 03 June 2024, 02:25:41
Alright, I'll have to look into this later since
Title: Re: [WIP] turnstile support - logind alternative
Post by: kiblaster on 06 June 2024, 09:32:53
1. tinydm starts also a GUI session and when that it is closed it restarts it.
    Can you do that with /etc/dinit.d/config/agetty-${tty}.conf?
2. In case one doesn't know you need to set the session:
Code: [Select]
tinydm-set-session -f -s /usr/share/xsessions/bspwm.desktop
4. tinydm uses startx https://gitlab.com/postmarketOS/tinydm/-/blob/master/tinydm-run-session.sh?ref_type=heads#L63.
Title: Re: [WIP] turnstile support - logind alternative
Post by: mrbrklyn on 05 August 2024, 07:35:43
System init: dinit.

The problem that I have with turnstile is the DISPLAY variable.
Picom, pasystray and lisgd (for gestures) need it .

So I use a shell script instead that it is launched inside the session.


Nearly everything I have has trouble with DISPLAY since wayland integration

ssh -X is all but worthless for a few years now.
Title: Re: [WIP] turnstile support - logind alternative
Post by: picokan on 10 August 2024, 11:35:25
Issues
  • polkit might not fully work, you'll need this patch (https://github.com/chimera-linux/cports/blob/master/main/polkit/patches/turnstile.patch) The patch should be included in Artix.
I can't get polkit to work and I'm not sure what I'm missing. User services and dbus session handling are both working, as well as multiple user sessions. Really only polkit isn't cooperating.
Title: Re: [WIP] turnstile support - logind alternative
Post by: kiblaster on 04 January 2025, 13:20:13
I tested turnstile again and it does not well.
When I log out the old (user) dinit process it's still there so no user services.
After disabling turnstile something kept spawning it so I rebooted.

I do not have elogind so I set in /etc/turnstile/turnstiled.conf
Code: [Select]
export_dbus_address = yes

I find a solution for the $DISPLAY error using env-file (man dinit-service):
Code: [Select]
type = process
command = picom
logfile = $HOME/.local/state/dinit/picom.log
env-file = environment
restart = true
"~" or "$HOME" do not work there while at least $HOME works in "command" so I used the relative path.

The file is in the service folder:
Code: [Select]
cat .config/dinit.d/environment
DISPLAY=:0
Title: Re: [WIP] turnstile support - logind alternative
Post by: Shoun2137 on 05 January 2025, 01:47:30
Spoiler (click to show/hide)
Title: Re: [WIP] turnstile support - logind alternative
Post by: kiblaster on 05 January 2025, 08:34:55
It's a mistake, now edited.
It was not a problem of different names.
Title: Re: [WIP] turnstile support - logind alternative
Post by: DAH on 20 February 2025, 13:50:41
After reading this thread, I installed the dinit/lxqt version of Artix on an old laptop, installed turnstile and seatd, and then used pacman -Rdd to remove elogind.  Once rebooted, the system did work.  The only major problem is the inability to elevate to root permission in programs that require it.  Shutting down, for example, has to be done via the command line -- "sudo shutdown."  Clicking the power off button brings up the do-you-really-want-to message, but when "yes" is clicked, nothing happens.  Programs that need to be run as root, like Gparted, won't load at all.

Also, a couple of times, when updating with pacman, elogind has been reinstalled as a requirement for other programs.  Each time that happened, I removed elogind and the system still worked afterward.

For what it's worth, I also installed the "experimental" wayland version of lxqt along with wayfire and found that it works nicely.  It looks like we're inching closer to a fully-functional version of Artix without elogind and with wayland.

Have you considered making an experimental ISO for Artix that has turnstile and seatd instead of elogind?  That might make it easier for more users to tinker with it.
Title: Re: [WIP] turnstile support - logind alternative
Post by: gripped on 20 February 2025, 16:46:34
First part sounds like maybe polkit needs elogind. I don't know much about turnstile.

If you don't want to keep uninstalling elogind you could create a dummy package.
Code: [Select]
pkgname='elogind-dummy'
pkgver=999
pkgrel=1
arch=(any)
provides=('elogind')
conflicts=('elogind')
Also you could try just disabling the elogind service and leave it installed to see if things work better. Could be better , could be worse. As I'm fairly sure some programs can start elogind themselves.
Title: Re: [WIP] turnstile support - logind alternative
Post by: kiblaster on 20 February 2025, 17:28:35
I have no elogind/seatd I think that some package should allow you do that.
I had to overwrite /etc/dinit.d/logind manually https://forum.artixlinux.org/index.php/topic,7626.msg45766.html#msg45766.
Title: Re: [WIP] turnstile support - logind alternative
Post by: Artist on 21 February 2025, 00:50:04
For the login1 part - as in reboot/shutdown - indeed polkit needs elogind.
As an alternative sudo or doas can be used to run the respective command, and also to initiate a suspend with a direct write.

artist
Title: Re: [WIP] turnstile support - logind alternative
Post by: capezotte on 25 March 2025, 04:48:46
Any prospect of turnstiled-s6? Not that it's super urgent, I can keep a 2-line execline script under adminsv just fine.
Title: Re: [WIP] turnstile support - logind alternative
Post by: capezotte on 17 August 2025, 22:06:31
The recent upgrade that merged dbus-dinit-user and dbus-dinit made it less comfortable to use Turnstile + dinit on other init systems.

Code: [Select]
# pacman -Syu
 :: Synchronizing package databases...
 system is up to date
 world is up to date
 galaxy is up to date
 lib32 is up to date
 extra is up to date
 multilib is up to date
:: Starting full system upgrade...
:: Replace dbus-dinit-user with system/dbus-dinit? [Y/n] n
resolving dependencies...
looking for conflicting packages...
:: dbus-dinit-20250815-3 and dbus-s6-20210918-1 are in conflict (init-dbus). Remove dbus-s6? [y/N] n
error: unresolvable package conflicts detected
error: failed to prepare transaction (conflicting dependencies)
:: dbus-dinit-20250815-3 and dbus-s6-20210918-1 are in conflict

Even if it's fairly easy to work around with a custom PKGBUILD, and Turnstile is non-default/experimental, I think splitting the packages still makes sense; dinit-user-spawn (which I think is the reason for this merger) seems easily portable to other inits and can also work as PID1-independent user services infrastructure, and it would make dinit-dbus more closely equivalent to the other dbus-init packages again.