You are not logged in.

#1 2024-05-08 08:28:13

dext
Member
From: Poland, Kraków
Registered: 2008-02-01
Posts: 108

loginctl enable-linger doesn't work

# loginctl show-user dext | grep Linger
Linger=yes

When dext in logged over ssh:

# loginctl            
SESSION  UID USER SEAT TTY   STATE   IDLE SINCE
     20    0 root -    pts/0 closing no   -    
  21524 1000 dext -    pts/0 closing no   -    
  21527    0 root -    pts/0 active  no   -    
  21574 1000 dext -    pts/1 active  no   -

When dext is not logged anywhere:

# loginctl
SESSION  UID USER SEAT TTY   STATE   IDLE SINCE
     20    0 root -    pts/0 closing no   -    
  21524 1000 dext -    pts/0 closing no   -    
  21527    0 root -    pts/0 active  no   -

My issue is I'm running a headless sound server, and currently dext has to keep a ssh session open for everything to work.

Offline

#2 2024-05-08 18:40:21

ayekat
Member
Registered: 2011-01-17
Posts: 1,611

Re: loginctl enable-linger doesn't work

How do you start that sound server?

Does the user manager for dext really not start? Check the state with

systemctl status user@1000.service

pkgshackscfgblag

Offline

#3 2024-05-09 08:41:19

dext
Member
From: Poland, Kraków
Registered: 2008-02-01
Posts: 108

Re: loginctl enable-linger doesn't work

This is how I start Pipewire:

dext@vaduz ~ % systemctl --user restart pipewire.service

status user@1000.service (yes, dext is 1000)

# systemctl status user@1000.service | grep ""                                     :(
● user@1000.service - User Manager for UID 1000
     Loaded: loaded (/usr/lib/systemd/system/user@.service; static)
    Drop-In: /usr/lib/systemd/system/user@.service.d
             └─10-login-barrier.conf
     Active: active (running) since Tue 2024-04-23 11:14:12 CEST; 2 weeks 1 day ago
       Docs: man:user@.service(5)
   Main PID: 619 (systemd)
     Status: "Ready."
[...]

Nothing worth noting changes after dext logs in and out over ssh:

# systemctl status user@1000.service > /tmp/dext_out.log
# systemctl status user@1000.service > /tmp/dext_in.log

# diff /tmp/dext_in.log /tmp/dext_out.log 
10,11c10,11
<      Memory: 111.8M (peak: 206.5M)
<         CPU: 18h 30min 8.078s
---
>      Memory: 111.6M (peak: 206.5M)
>         CPU: 18h 30min 9.943s

One extra thing I found out while observing bluetooth.service.
Phone is connected to the server over bluetooth, everything works. Then dext logs out, here's what shows up in bluetooth.service:

May 09 10:33:25 vaduz bluetoothd[532]: Endpoint unregistered: sender=:1.139 path=/MediaEndpoint/A2DPSource/(many different types)

Pipewire works fine all the time - I use it over ROC and S/PDIF. Only Bluetooth has this issue. And it worked for years without problems on Pulseaudio now Pipewire. The problem showed up 3-4 month ago after system upgrade.

Offline

#4 2024-05-10 21:14:39

ayekat
Member
Registered: 2011-01-17
Posts: 1,611

Re: loginctl enable-linger doesn't work

From what I can tell, your systemd user instance starts correctly, so lingering should work.

I'm afraid I'm not too familiar with Pipewire nor Bluetooth, so I'm afraid I'm of limited help here. I hope someone else stumbles over this for further help.


pkgshackscfgblag

Offline

#5 2024-05-11 12:56:32

ua4000
Member
Registered: 2015-10-14
Posts: 487

Re: loginctl enable-linger doesn't work

Please post

loginctl list-users 

ls -la  /var/lib/systemd/linger

And you could try

systemctl --user reenable pipewire.service
systemctl --user is-enabled pipewire.service

So that pipewire is run automatically and not depending on user login.

Offline

#6 2024-05-14 05:30:02

dext
Member
From: Poland, Kraków
Registered: 2008-02-01
Posts: 108

Re: loginctl enable-linger doesn't work

# loginctl list-users 

 UID USER LINGER STATE  
   0 root no     active
1000 dext yes    closing
# ls -la  /var/lib/systemd/linger
total 8
drwxr-xr-x  2 root root 4096 May  8 10:21 ./
drwxr-xr-x 10 root root 4096 Sep 10  2023 ../
-rw-r--r--  1 root root    0 May  8 10:21 dext

Pipewire was enabled and it works, I use it all the time over ROC and SPDIF, only Bluetooth is the problem.

What's interesting, after I ssh to root, then:

# su - dext
% systemctl --user is-enabled pipewire.service
Failed to connect to bus: No medium found

I have to have direct ssh session to dext user, it can't be ssh to root then su to dext.

Offline

#7 2024-05-14 06:49:21

ayekat
Member
Registered: 2011-01-17
Posts: 1,611

Re: loginctl enable-linger doesn't work

If you use su, it won't go through the login process with pam_systemd.so, so XDG_RUNTIME_DIR won't be set (and thus you cannot communicate with dbus and systemd).


pkgshackscfgblag

Offline

Board footer

Powered by FluxBB