Skip to main content
Topic: [Help] dinit-client fails to connect to a socket as user (Read 1400 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[Help] dinit-client fails to connect to a socket as user

Hi, I am using dinit for system services and I'd like to use it for user services as well.

So far I have created working system service files for dinit and generally my init system works well (no issues).

But when I try to use any command as non-root user, this is the output:

Code: [Select]
$: dinitctl enable test
dinit-client: connecting to socket /run/user/1000/dinitctl: No such file or directory

Thank you in advance if you read it so far.

Re: [Help] dinit-client fails to connect to a socket as user

Reply #1
As far as I'm aware, I thought using dinitctl required elevated privileges by default (for same security reasons as pacman etc)? (once its enabled, its enabled irrespective of reboots etc)

Re: [Help] dinit-client fails to connect to a socket as user

Reply #2
But when I try to use any command as non-root user, this is the output:

Have you actually got a user-session instance of dinit running? People have used dinit-userservd for this, see: https://forum.artixlinux.org/index.php/topic,3468.0.html

(The system dinit instance won't manager user-session services, you need to run a user instance for that; dinit-userservd will take care of starting it for you when you log in).

As far as I'm aware, I thought using dinitctl required elevated privileges by default

Not for managing user session services, just for the system services.

 

Re: [Help] dinit-client fails to connect to a socket as user

Reply #3
When I was setting up my dinit user session I didn't fully understand (I honestly still don't) what dinit-userservd does with all that pam module stuff, so I opted not to use it.

Instead I wanted an easier approach that could also have a dbus user session as a service together with pipewire services, window manager, compositor... So I'll share my approach here.

First set vars for DBUS_SESSION_BUS_ADDRESS, XDG_RUNTIME_DIR, then start the dinit user session instance, all on `~/.bash_profile`:
Code: [Select]
export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/dbus-session
export XDG_RUNTIME_DIR=/run/user/1000

exec dinit >> ~/.local/share/dinit/dinit.log &

Then for any user service I prefer to add them in `~/.config/dinit.d/` and enable/softlink to `~/.config/dinit.d/boot.d/`.

My dbus service is as follows `~/.config/dinit.d/dbus`
Code: [Select]
type=process
command = /usr/bin/dbus-daemon --session --nofork --nopidfile --print-address 5 --address $DBUS_SESSION_BUS_ADDRESS
load-options = sub-vars
logfile = /home/look/.local/share/dinit/dbus.log
ready-notification=pipefd:5

I'm still not quiet sure what I'm missing by using this instead of dinit-userservd but its a working alternative for me, been daily driving this way for months without any problems.