chimera-linux / turnstile

Independent session/login tracker
BSD 2-Clause "Simplified" License
89 stars 8 forks source link

Unable to start user Dinit instance under Artix Linux #6

Closed 62832 closed 1 year ago

62832 commented 1 year ago

To preface, I have previously posted a GitHub discussion on the Dinit repo regarding where to start Dinit from to manage user services. My wish was to be able to start it from within a running system instance of Dinit in order to manage both system services and user services effectively under the same instance, without needing to start an unsupervised user instance from something like .bash_profile.

I realise, of course, that I'm probably way over my head when it comes to this, but I'm not sure whether I entirely understand the current scope and instructions for Turnstile as it stands. I was hoping to make use of it in order to start my user instance of Dinit under Artix Linux, but I have been unable to even get the user instance to start following the standalone instructions - make/install, load the PAM module, enable the service (without the Chimera-specific dependencies) and hope it works.

dinit-client: connecting to socket /run/user/1000/dinitctl: No such file or directory

Initially, I decided against making an issue here to not further pollute any related comms channels with my own failed attempts at setting up, though I imagine this would in fact be the quickest way to address it in the end.

I should mention that there did exist an Artix-specific fork of Turnstile (back then called dinit-userservd), though I don't know if this is further being maintained and would rather try to keep up with the upstream repo in the hopes of eventually maintaining an up-to-date package for Artix. It would be reassuring to know whether the project has changed on a deeper level since then that would make it somehow infeasible to use now on my given distro.

62832 commented 1 year ago

@q66 Sorry for the bother, but it's been a while since I posted this and I haven't yet received a response. Would it be appropriate to ask for some guidance on setting up Turnstile on Artix still?

q66 commented 1 year ago

there isn't really anything i can help you with here, i don't know artix's setup, you'll have to enable debug and figure out from the log what's happening (possibly add your own logging in the code as appropriate)

if i had to guess it has to do with the PAM session the dinit instance is run in failing to be established (somebody else had that issue on IRC), i couldn't see any bug on turnstile's side regarding the PAM session, so either you might have to adjust the PAM session script to match whatever arrangement you have on your system or something else

in any case, it's up to you to figure out, what i've seen of artix and especially their service management integration was mostly a half-baked mess and i'm not gonna look into it

patches welcome

thequantumcog commented 1 year ago

add this line to /etc/pam.d/login and reboot session optional pam_dinit_userservd.so

Edit: I am using the artix forked version

q66 commented 1 year ago

to be clear, when i talk of the PAM session the dinit instance is run in, i mean the support recently added with https://github.com/chimera-linux/turnstile/commit/bc85b2cf13b6892ccf0a2f5f847045babecf70f1

presumably @62832 has already done the initial PAM setup for turnstile itself

q66 commented 1 year ago

I just pushed a change that might theoretically be relevant. No idea if it'll do anything though (feel free to test)

q66 commented 1 year ago

there is also a 0.1.4 release now (verified to work on my machines) so you don't have to test a random tag

62832 commented 1 year ago

Yep, I think it's getting closer now. The user session for Dinit does start, although none of my user scripts seem to run properly. This is what I get on an Artix VM when I run dinitctl list, both before and after removing an initial boot service file.

image

q66 commented 1 year ago

this looks like a problem with your scripts, so i'm closing this

62832 commented 1 year ago

I find that odd, considering that the scripts worked perfectly fine prior to setting up Turnstile on this machine. I'll have to see what adaptations these would need now.

q66 commented 1 year ago

depending on your prior setup that doesn't necessarily mean anything

turnstile dinit runs out of band so you need to ensure the service environment and other things are proper, e.g. session bus address exported into activation environment prior to dbus-using services being activated and so on

62832 commented 1 year ago

I've so far managed to adjust most of my init scripts bar one or two, so if it's alright with you I'd like to ask for some clarification. What would be the proper usage of dinitctl setenv for any required environment variables when using Turnstile? In particular, I am not quite sure of the proper use for two services: