Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to start user Dinit instance under Artix Linux #6

Closed
62832 opened this issue May 15, 2023 · 11 comments
Closed

Unable to start user Dinit instance under Artix Linux #6

62832 opened this issue May 15, 2023 · 11 comments

Comments

@62832
Copy link

62832 commented May 15, 2023

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
Copy link
Author

62832 commented May 23, 2023

@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
Copy link
Member

q66 commented Jun 24, 2023

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
Copy link

thequantumcog commented Jun 26, 2023

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
Copy link
Member

q66 commented Jun 26, 2023

to be clear, when i talk of the PAM session the dinit instance is run in, i mean the support recently added with bc85b2c

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

q66 added a commit that referenced this issue Jun 26, 2023
It seems some PAM setups will fail setcred if no authentication
module is in place. We use PAM to establish the dinit session
only when root, so use rootok.

The loginuid however does not make any sense as we will switch
the user immediately afterwards (to the user the service manager
backend runs as).

Also make turnstiled module required, right now it does nothing
and always returns success, but we might want to utilize it at
a later point.

Ref #6
@q66
Copy link
Member

q66 commented Jun 26, 2023

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

@q66
Copy link
Member

q66 commented Jun 26, 2023

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
Copy link
Author

62832 commented Jun 26, 2023

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
Copy link
Member

q66 commented Jun 26, 2023

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

@q66 q66 closed this as completed Jun 26, 2023
@62832
Copy link
Author

62832 commented Jun 26, 2023

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
Copy link
Member

q66 commented Jun 26, 2023

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
Copy link
Author

62832 commented Jun 27, 2023

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:

  • dbus-session: Currently this is just a copy of the D-Bus user session service on the dinit-userservd services repo with an accompanying script to handle exporting the session bus socket address. Since Turnstile is supposed to be able to handle the exporting on its own, what would be the redundant part to remove from the current script?
  • clipmenud: As this service is for a program listening on the current (Xorg) graphical session, it requires DISPLAY to be set. How would I be able to let Turnstile recognise the value of DISPLAY in the current environment using dinitctl setenv? This has been sorted by including dinitctl setenv DISPLAY XAUTHORITY in an .xinitrc equivalent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants