I got done today switching my current main machine from runit to dinit since I found it to be a much nicer and faster init system. Since then, I've been wondering what the best place to start dinit from would be for user services.
Currently, my main machine runs KDE Plasma with SDDM enabled. On a virtual machine, I have a minimal setup with dwm and sx to start the graphical session without a display manager like SDDM. The latter starts dinit via
sxrc before the window manager itself, while the former currently starts it from
.bash_profile for lack of any better ideas.
Ideally, I'd want to start dinit from somewhere that's
- versatile (i.e. works for most configurations and systems regardless of DE/WM and DM/startx/sx choice)
- self-contained (i.e. from someplace within $HOME rather than anywhere that requires root permissions)
With that said, where would I be best off starting dinit from as opposed to a
dinit & at the end of
.bash_profile?
Bumping to clarify how to actually set up turnstile/dinit-userservd since I have not had much luck previously in setting that up and getting it to work so far. How do I go about doing so to make sure my user instance of dinit gets managed by the initial system instance?
From the documentation:
By "in your login path" it means in the
/etc/pam.d/login file.
That should be all you need, other than setting up your user services.
Fair enough, though I feel like I failed up until now to specify that I've been adhering — probably too much for my own good — to the XDG base dir spec and trying to use those environment variables within my script definitions. For example, this is my current script to start a D-Bus user session.
type = process
load-options = sub-vars
logfile = $XDG_STATE_HOME/dinit/dbus-session.log
command = $XDG_CONFIG_HOME/dinit.d/scripts/dbus-session --print-address 3
smooth-recovery=true
ready-notification = pipefd:3
How would I go about specifying these variables to be recognised by the running user instance under
dinit-userservd?
I'm not sure those variables are guaranteed to be set, at all. Applications are supposed to use their values if they are set or use a default if not. (Are they set in your terminal?) Elogind manages XDG_RUNTIME_DIR but not, I think, the others.
Therefore, you probably shouldn't use them unconditionally in file paths.
There are some example services here: https://github.com/Xynonners/dinit-userservd-services/tree/main/services
Alright then, thank you. Changing those variables to what they would normally default to — and I do normally have those variables defined in my .bash_profile — did the trick, and now dinit-userservd seems to work. I still wish it were possible to use those variables directly but it's not really urgent for now.
What I would like to do eventually is figure out how to get the more current turnstile to work on an Artix installation, though that one when set up never seemed to even run a user instance of dinit upon logging in. Maybe there's still some crucial step I'm missing with that one aside from "build and install, enable the PAM module and service and restart".