Skip to main content
Topic: dinit-userservd doesn't spawn user dinit (Read 2668 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

dinit-userservd doesn't spawn user dinit

I installed the artix fork of dinit-userservd (https://github.com/Xynonners/dinit-userservd), started the service, and added "session optional pam_dinit_userservd.so" to /etc/pam.d/login, but the dinit user instance still doesn't spawn. What might I be missing here?

Re: dinit-userservd doesn't spawn user dinit

Reply #1
Do you have your user services set up (i.e. service descriptions in place), including a `boot` service?


Re: dinit-userservd doesn't spawn user dinit

Reply #3
Anything in /var/log/dinit-userservd.log?



Re: dinit-userservd doesn't spawn user dinit

Reply #6
It's completely empty. The process dinit-userservd itself starts just fine though, it just doesn't spawn the user dinit instance for whatever reason.
It does work for me. Make sure your /etc/security/login is correct with modules in the right order. Mine looks like:

Code: [Select]
#%PAM-1.0

auth required pam_securetty.so
auth requisite pam_nologin.so
auth include system-local-login
account include system-local-login
session include system-local-login
session optional pam_dinit_userservd.so
password include system-local-login

If that's what you also have and it doesn't work, I guess you would need to debug it. See if you can find if PAM itself has logged anything; perhaps try running strace on the dinit-userservd process.

 

Re: dinit-userservd doesn't spawn user dinit

Reply #7
It's completely empty. The process dinit-userservd itself starts just fine though, it just doesn't spawn the user dinit instance for whatever reason.

Same here and I used the /etc/security/login above.

Do you use "strace dinitctl restart dinit-userservd" to debug?

Re: dinit-userservd doesn't spawn user dinit

Reply #8
Do you use "strace dinitctl restart dinit-userservd" to debug?
You need to trace dinit-userservd, not dinitctl. I was thinking along the lines of:
  • login on a virtual terminal as root, strace the dinit-userservd process by its pid
  • seperately log in as user
  • go back to the root terminal and check the trace for activity
If you see activity in the trace, hopefully it gives some clue to what's going wrong. If there's no activity it means your PAM configuration isn't right or the pam_dinit_userservd.so PAM module isn't working properly; in either case the PAM logs are probably the best bet.

Re: dinit-userservd doesn't spawn user dinit

Reply #9
same issue here with dinit-userservd. service itself starts, but user services do not run. /var/log/dinit-userservd.log does not show anything and /etc/security/login does not exist in my case. well, is should be in /etc/pam.d/login but still it cannot run user service or write anything to its logfile.

running the dir with dinit as user works fine.

UPDATE:
well i got it fixed. from the reddit post, 'session optional pam_dinit_userservd.so' should be in '/etc/pam.d/system-login' (at least for me) and not in /etc/pam.d/login as the original guide suggested. now dinit-runservd spawns dinit --user correctly and runs users services fine.

new issue though. as using this method will cause "dinitctl" to loose the socket of dinit when you logout from the session and log back in. you needed to reboot in order for this to work again. not sure how to deal with that yet.

Re: dinit-userservd doesn't spawn user dinit

Reply #10
Quote
'session optional pam_dinit_userservd.so' should be in '/etc/pam.d/system-login' (at least for me) and not in /etc/pam.d/login as the original guide suggested. now dinit-runservd spawns dinit --user correctly and runs users services fine.

Putting it in login works for me, but that's with console login. If you're using a display manager it could be different. I think system-login is probably more correct; that seems to get included by other logins anyway.

However:

Quote
new issue though. as using this method will cause "dinitctl" to loose the socket of dinit when you logout from the session and log back in. you needed to reboot in order for this to work again. not sure how to deal with that yet

I'm pretty sure elogind is managing the runtime dir, so I believe it's important to make sure that the elogind pam module is listed before the dinit-userservd module. With that arrangement, it all works fine and I don't get this problem. On the other hand if I put them the other way around, dinitctl never has a socket to work with, so this doesn't seem to be exactly the same as what you're describing.

Re: dinit-userservd doesn't spawn user dinit

Reply #11
well, i guess my problem because i was using greetd/greetd-gtkgreet combo as my login manager.  somehow it breaks the user session. logging in through TTY work fine. not tested yet if things still work when switching to another user.

Re: dinit-userservd doesn't spawn user dinit

Reply #12
Using /etc/pam.d/system-login worked but some services that normally works now fail.
Code: [Select]
cat /etc/pam.d/system-login 
#%PAM-1.0

auth       required   pam_shells.so
auth       requisite  pam_nologin.so
auth       include    system-auth

account    required   pam_access.so
account    required   pam_nologin.so
account    include    system-auth

password   include    system-auth

session    optional   pam_loginuid.so
session    optional   pam_keyinit.so       force revoke
session    include    system-auth
session    optional   pam_motd.so
session    optional   pam_mail.so          dir=/var/spool/mail standard quiet
session    optional   pam_umask.so
-session   optional   pam_elogind.so
session    required   pam_env.so           user_readenv=1
-session    optional   pam_rundir.so
session optional pam_dinit_userservd.so

Also after logging out it wasn't working anymore, dinitctl couldn't find the dinit instance.
I ran pkill dinit, there was a process, and after logging out the instance was fine.
I logged out a few times looks like it is always like that.

picom:
Code: [Select]
[ 09/28/23 21:32:52.123 main FATAL ERROR ] Can't open display.
pasystray:
Code: [Select]
option parsing failed: Cannot open display: 
option parsing failed: Cannot open display:
option parsing failed: Cannot open display:
wireplumber:
Code: [Select]
Error acquiring bus address: Cannot autolaunch D-Bus without X11 $DISPLAY
M 21:32:51.530117            pw.core ../pipewire/src/pipewire/core.c:180:destroy_proxy: 0x55855eb08730: leaked proxy 0x55855ebaa280 id:4
M 21:32:51.530226        wireplumber ../wireplumber/src/main.c:364:on_disconnected: disconnected from pipewire
Error acquiring bus address: Cannot autolaunch D-Bus without X11 $DISPLAY
M 21:32:51.736933            pw.core ../pipewire/src/pipewire/core.c:180:destroy_proxy: 0x558fe612b550: leaked proxy 0x558fe61c46d0 id:3
M 21:32:51.736994        wireplumber ../wireplumber/src/main.c:364:on_disconnected: disconnected from pipewire
Error acquiring bus address: Cannot autolaunch D-Bus without X11 $DISPLAY
M 21:32:51.934022            pw.core ../pipewire/src/pipewire/core.c:180:destroy_proxy: 0x55cf5a326550: leaked proxy 0x55cf5a3be9b0 id:3
M 21:32:51.934076        wireplumber ../wireplumber/src/main.c:364:on_disconnected: disconnected from pipewire
Error acquiring bus address: Cannot autolaunch D-Bus without X11 $DISPLAY
M 21:32:52.135160            pw.core ../pipewire/src/pipewire/core.c:180:destroy_proxy: 0x56508faf3690: leaked proxy 0x56508fb8f870 id:3
M 21:32:52.135249        wireplumber ../wireplumber/src/main.c:364:on_disconnected: disconnected from pipewire

Re: dinit-userservd doesn't spawn user dinit

Reply #13
@kikblaster

what loginmanager are you using?

it appears that when using only tty to login/logout, the '/run/user/$UID' does not gets wipe hence dinitctl in user-mode works. while when using loginmanager (i've used greetd and ly) '/run/user/$UID'  is wiped out. and no matter how dinit-userservd is restarted it can never respawn a dinit instance for the currently logged-in user.