On Thu, Oct 31, 2024 at 03:53:56PM +0100, Christoph Berg wrote:
> I'm now getting a full user systemd including dbus and pipewire when
> logging into the postgres user account:
> 
> [0] 15:51 myon@turing:~ $ sudo -iu postgres
> [0] 15:51 postgres@turing:~ $ ps xf
>     PID TTY      STAT   TIME COMMAND
>  113664 pts/8    S      0:00 -bash
>  113688 pts/8    R+     0:00  \_ ps xf
>  113641 ?        Ss     0:00 /usr/lib/systemd/systemd --user
>  113642 ?        S      0:00  \_ (sd-pam)
>  113660 ?        Ssl    0:00  \_ /usr/bin/pipewire
>  113661 ?        Ssl    0:00  \_ /usr/bin/pipewire -c filter-chain.conf
>  113663 ?        Ssl    0:00  \_ /usr/bin/wireplumber
>  113665 ?        Ssl    0:00  \_ /usr/bin/pipewire-pulse
>  113668 ?        Ss     0:00  \_ /usr/bin/dbus-daemon --session 
> --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
> [0] 15:51 postgres@turing:~ $ id
> uid=118(postgres) gid=127(postgres) Gruppen=127(postgres),110(ssl-cert)
> [0] 15:52 postgres@turing:~ $

I cannot reproduce this on unstable in a minimal container with systemd 
as pid 1, libpam-systemd installed:

290388f0f485 login: mh
Password:
Linux 290388f0f485 6.18.5+deb14-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.18.5-1 
(2026-01-16) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
mh@290388f0f485:~$ systemctl --user status
● 290388f0f485
    State: running
    Units: 40 loaded (incl. loaded aliases)
     Jobs: 0 queued
   Failed: 0 units
    Since: Thu 2026-01-29 08:08:00 UTC; 7s ago
  systemd: 259-1
  Tainted: unmerged-bin
   CGroup: /user.slice/user-1000.slice/[email protected]
           └─init.scope
             ├─6006 /usr/lib/systemd/systemd --user
             └─6008 "(sd-pam)"
mh@290388f0f485:~$ ps xf
    PID TTY      STAT   TIME COMMAND
   6015 pts/0    Ss     0:00 -bash
   6054 pts/0    R+     0:00  \_ ps xf
   6006 ?        Ss     0:00 /usr/lib/systemd/systemd --user
   6008 ?        S      0:00  \_ (sd-pam)
mh@290388f0f485:~$ sudo -iu postgres
[sudo] password for mh:
postgres@290388f0f485:~$ ps xf
    PID TTY      STAT   TIME COMMAND
   6069 pts/1    S      0:00 -bash
   6082 pts/1    R+     0:00  \_ ps xf
postgres@290388f0f485:~$ systemctl --user status
Failed to connect to user scope bus via local transport: 
$DBUS_SESSION_BUS_ADDRESS and $XDG_RUNTIME_DIR not defined (consider using 
--machine=<user>@.host --user to connect to bus of other user)
postgres@290388f0f485:~$ loginctl
SESSION  UID USER SEAT LEADER CLASS   TTY   IDLE SINCE
     c3 1000 mh   -    5996   user    pts/0 no   -
     c4 1000 mh   -    6006   manager -     no   -

2 sessions listed.
postgres@290388f0f485:~$

Maybe my container is missing some packages? I am pasting reportbug 
output of the container at the bottom of this mail.

Then, I tried this on my postgresql database server, and things are fine 
there as well:

[1/1271]mh@derriere:~ $ ps xf
    PID TTY      STAT   TIME COMMAND
  29865 ?        S      0:00 sshd-session: mh@pts/2
  29866 pts/2    Ss     0:00  \_ -bash
  30175 pts/2    R+     0:00      \_ ps xf
  29791 ?        Ss     0:00 /usr/lib/systemd/systemd --user
  29795 ?        S      0:00  \_ (sd-pam)
[2/1272]mh@derriere:~ $ loginctl
SESSION  UID USER SEAT LEADER CLASS   TTY IDLE SINCE
     78 1001 mh   -    29784  user    -   no   -
     79 1001 mh   -    29791  manager -   no   -

2 sessions listed.
[3/1273]mh@derriere:~ $ sudo -iu postgres
[sudo] password for mh on derriere:
postgres@derriere:~$ ps xf
    PID TTY      STAT   TIME COMMAND
  30210 pts/3    S      0:00 -bash
  30214 pts/3    R+     0:00  \_ ps xf
    579 ?        Ss     0:10 /usr/lib/postgresql/17/bin/postgres -D /var/lib/pos
    801 ?        Ss     0:00  \_ postgres: 17/main: checkpointer
    803 ?        Ss     0:01  \_ postgres: 17/main: background writer
    911 ?        Ss     0:08  \_ postgres: 17/main: walwriter
    912 ?        Ss     0:01  \_ postgres: 17/main: autovacuum launcher
    913 ?        Ss     0:00  \_ postgres: 17/main: logical replication launcher
postgres@derriere:~$ loginctl
SESSION  UID USER SEAT LEADER CLASS   TTY IDLE SINCE
     78 1001 mh   -    29784  user    -   no   -
     79 1001 mh   -    29791  manager -   no   -

2 sessions listed.
postgres@derriere:~$

What am I doing wrong here?

Greetings
Marc

-- System Information:
Debian Release: forky/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 6.18.5+deb14-amd64 (SMP w/12 CPU threads; PREEMPT)
Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages sudo depends on:
ii  init-system-helpers  1.69
ii  libapparmor1         4.1.3-1
ii  libaudit1            1:4.1.2-1+b1
ii  libc6                2.42-11
ii  libpam-modules       1.7.0-5+b1
ii  libpam0g             1.7.0-5+b1
ii  libselinux1          3.9-4+b1
ii  libssl3t64           3.5.5-1
ii  zlib1g               1:1.3.dfsg+really1.3.1-1+b2

sudo recommends no packages.

sudo suggests no packages.

-- Configuration Files:
/etc/sudoers [Errno 13] Permission denied: '/etc/sudoers'

-- no debconf information
Thank you for using reportbug

Reply via email to