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

[WIP] turnstile support - logind alternative

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?
  • a session/login tracker
  • a service-manager-agnostic way to manage per-user service managers for user services

For more information, see: its GitHub page

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.

Features
  • Session tracking
    See /run/turnstiled/$(id-u)/session.* for example of how your session is tracked
  • User services management
    turnstile will automatically provide user services management through its backends, you can use what is officially supported or even write your own (if you have something unsupported by default). Quite handy for graphical sessions.
    I have provided some of the packages, such as mpd-dinit-user, dbus-dinit-user, and pipewire-dinit, as turnstile support for Artix matures I expect more dinit packages in mainline will be moved to user packages (such as syncthing)
  • Rundir management
    turnstile also provides full replacement for pam_rundir, turnstile can manage user's $XDG_RUNTIME_DIR.
    To make turnstile manage rundir, edit /etc/turnstile/turnstiled.conf and set manage_rundir to yes
    WARNING: You will need to remove elogind by issuing pacman -Rdd elogind, otherwise elogind and turnstile will conflict.
    Since elogind also provides seat management, you may want to install and enable seatd service. See seatd forum post for more information about seatd installation (particularly adding user to group).
    Since elogind also handles ACPI, you may want to install and enable acpid.
  • Automatic dbus session handling
    I know some of you might hate dbus, but for those who don't mind, it can also handle $DBUS_SESSION_BUS_ADDRESS nicely because of how turnstile handles user services. See dbus-dinit-user package. At least your .xinitrc will be cleaner as a result.

Issues
  • polkit might not fully work, you'll need this patch The patch should be included in Artix.
  • To make turnstile manage rundir while elogind is installed, you'll need this patch, full support lingering through turnstile is also managed this way.
  • TBA

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!
now only the dinit guy in artix

Re: [WIP] turnstile support - logind alternative

Reply #1
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.

Re: [WIP] turnstile support - logind alternative

Reply #2
Committed a new file 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.
now only the dinit guy in artix

Re: [WIP] turnstile support - logind alternative

Reply #3
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.



Re: [WIP] turnstile support - logind alternative

Reply #4
What's the content of your .xinitrc file?
now only the dinit guy in artix

Re: [WIP] turnstile support - logind alternative

Reply #5
I do not have it.

I use ~/.config/bspwm/bspwmrc.


Re: [WIP] turnstile support - logind alternative

Reply #7
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?)

Re: [WIP] turnstile support - logind alternative

Reply #8
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, since we're talking user instance here, it won't be read).
now only the dinit guy in artix

Re: [WIP] turnstile support - logind alternative

Reply #9
I do not have it.

I use ~/.config/bspwm/bspwmrc.

and how do you start bspwm from login? startx?
I use tinydm.

tinydm-1.1.3-1
tinydm source

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/

Re: [WIP] turnstile support - logind alternative

Reply #10


and how do you start bspwm from login? startx?
I use tinydm.

tinydm-1.1.3-1
tinydm source

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/.
now only the dinit guy in artix

Re: [WIP] turnstile support - logind alternative

Reply #11
It did not work.

Re: [WIP] turnstile support - logind alternative

Reply #12
Alright, I'll have to look into this later since
  • tinydm is never a supported DM (it's essentially a glorified autologin which you can do it from /etc/dinit.d/config/agetty-${tty}.conf)
  • I can't even get it to run
  • I can't reproduce it by logging in through lxdm or lightdm (logging into openbox-session with picom enabled)
  • I can, however, reproduce it when trying to startx directly upon login (without using any DMs, so tty only), I think a workaround can be done at this stage
now only the dinit guy in artix

 

Re: [WIP] turnstile support - logind alternative

Reply #13
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.