#999596 sddm unnecessarily starts pulseaudio with sytemd user serssion

Package:
sddm
Source:
sddm
Description:
modern display manager for X11
Submitter:
Patrick Häcker
Date:
2021-11-13 05:42:02 UTC
Severity:
normal
#999596#5
Date:
2021-11-13 05:18:31 UTC
From:
To:
Dear Maintainer,

I am not really sure, if this is a sddm, pulseaudio or systemd bug, as all
three seem somehow involved:

Pulseaudio installs pulseaudio.service and pulseaudio.socket below
/usr/lib/systemd/user/ i.e. pulseaudio is started for every systemd user
session. As sddm is started with the user sddm, this starts a systemd user
session and therefore sddm starts pulseaudio.

This seems to be totally unnecessary, and leads to a warning when logging in
with the normal user. The shortened output of
"journalctl --priority warning --boot --output verbose" contains
    PRIORITY=4
    _TRANSPORT=journal
    _UID=121
    _GID=142
    _AUDIT_LOGINUID=121
    _SYSTEMD_OWNER_UID=121
    _SYSTEMD_SLICE=user-121.slice
    _SYSTEMD_UNIT=user@121.service
    _PID=1010
    MESSAGE=After module unload, module 'module-null-sink' was still loaded!
    CODE_FILE=../src/pulsecore/module.c
    CODE_FUNC=pa_module_unload_all
    CODE_LINE=367
    SYSLOG_IDENTIFIER=pulseaudio
    _COMM=pulseaudio
    _EXE=/usr/bin/pulseaudio
    _CMDLINE=/usr/bin/pulseaudio --daemonize=no --log-target=journal
    _SYSTEMD_CGROUP=/user.slice/user-121.slice/user@121.service/session.slice/pulseaudio.service
    _SYSTEMD_USER_UNIT=pulseaudio.service
    _SYSTEMD_USER_SLICE=session.slice
I confirmed that user sddm has a pulseaudio process running when no user is
logged in with SDDM.

sddm should most probably not start pulseaudio at all and maybe also not all
the other services in a systemd user session and possibly no systemd user
session in the beginning.

Kind regards
Patrick

#999596#10
Date:
2021-11-13 05:38:24 UTC
From:
To:
The specific problem can be avoided with:

mkdir -p /var/lib/sddm/.config/systemd/user
chown -R sddm: /var/lib/sddm/.config/systemd
ln -s /dev/null /var/lib/sddm/.config/systemd/user/pulseaudio.service
ln -s /dev/null /var/lib/sddm/.config/systemd/user/pulseaudio.socket

Adding something like this to the sddm package would improve things
immediately.
Duplicating something like this into every display manager package seems
to be kind of wrong, however.