Bug 273605 - audio/pulseaudio: Daemon startup failed in system-wide mode
Summary: audio/pulseaudio: Daemon startup failed in system-wide mode
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-desktop (Team)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-06 19:14 UTC by Jesús Daniel Colmenares Oviedo
Modified: 2024-12-12 21:07 UTC (History)
5 users (show)

See Also:
jbeich: exp-run+


Attachments
Globally override --localstatedir (4.87 KB, patch)
2024-12-08 08:54 UTC, Jan Beich
no flags Details | Diff
Globally override --localstatedir (8.23 KB, patch)
2024-12-08 09:00 UTC, Jan Beich
no flags Details | Diff
Globally override --localstatedir (5.89 KB, patch)
2024-12-08 09:07 UTC, Jan Beich
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jesús Daniel Colmenares Oviedo 2023-09-06 19:14:38 UTC
Description:

I have written a small rc script to run pulseaudio in system-wide mode using the following parameters (see Output). After upgrading pulseaudio a few weeks ago I noticed that pulseaudio cannot be started again in system-wide mode. I didn't have time at that time to test some things to get more information so I haven't reported it until today.

Note: I know that running pulseaudio in system-wide mode is not recommended except in some cases.

Output:

```
# pulseaudio -D --system --disallow-module-loading --disallow-exit
N: [(null)] main.c: Running in system mode, forcibly disabling SHM mode.
N: [(null)] main.c: Running in system mode, forcibly disabling exit idle time.
E: [(null)] main.c: Daemon startup failed.
# tail -3 /var/log/messages
Sep  6 14:57:17 dtxdf-test pulseaudio[19404]: [(null)] main.c: Home directory of user 'pulse' is not '/var/local/run/pulse', ignoring.
Sep  6 14:57:17 dtxdf-test pulseaudio[19404]: [(null)] caps.c: Normally all extra capabilities would be dropped now, but that's impossible because PulseAudio was built without capabilities support.
Sep  6 14:57:17 dtxdf-test pulseaudio[19404]: [(null)] core-util.c: Failed to create secure directory (/var/local/lib/pulse): Permission denied
```
Comment 1 Tatsuki Makino 2023-09-08 21:20:36 UTC
localstatedir may be bad.
Excerpts from phase:configure

Message: 
    ---{ pulseaudio 16.1 }---
    
    prefix:                        /usr/local
    bindir:                        /usr/local/bin
    libdir:                        /usr/local/lib
    libexecdir:                    /usr/local/libexec
    mandir:                        /usr/local/man
    datadir:                       /usr/local/share
    sysconfdir:                    /usr/local/etc
    localstatedir:                 /var/local
    modlibexecdir:                 /usr/local/lib/pulseaudio/modules
    alsadatadir:                   /usr/local/share/pulseaudio/alsa-mixer
    System Runtime Path:           /var/local/run/pulse
    System State Path:             /var/local/lib/pulse
    System Config Path:            /var/local/lib/pulse
    Bash completions directory:    /usr/local/share/bash-completion/completions
    Zsh completions directory:     /usr/local/share/zsh/site-functions
    Compiler:                      clang 13.0.0
    
    Enable pulseaudio daemon:      true
    Enable pulseaudio client:      true
Comment 2 Jan Beich freebsd_committer freebsd_triage 2024-12-08 08:54:58 UTC
Created attachment 255698 [details]
Globally override --localstatedir

Regressed by bug 262713 which removed explicit --localstatedir=/var obsoleted by bug 199506 but not ported to USES=meson.
Comment 3 Jan Beich freebsd_committer freebsd_triage 2024-12-08 09:00:03 UTC
Created attachment 255699 [details]
Globally override --localstatedir

Also cleanup explicit --localstatedir, not just -Dlocalstatedir
Comment 4 Jan Beich freebsd_committer freebsd_triage 2024-12-08 09:07:44 UTC
Created attachment 255700 [details]
Globally override --localstatedir

emulators/qemu* don't have USES=meson, so revert the cleanup there.
Comment 6 Charlie Li freebsd_committer freebsd_triage 2024-12-10 16:13:04 UTC
(In reply to Antoine Brodin from comment #5)
localstatedir needs to be locally set for sysutils/pacman; the global override is incorrect.
Comment 7 Jan Beich freebsd_committer freebsd_triage 2024-12-12 20:55:58 UTC
(In reply to Charlie Li from comment #6)
Consumers are able to override --localstatedir. However, -Dlocalstatedir seems to have lower priority than --localstatedir thus needs to be converted.

After fixing both pacman and archlinux-keyring (its consumer) built fine here.
Comment 8 commit-hook freebsd_committer freebsd_triage 2024-12-12 20:58:19 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=f735bc3d93c4559aef3b2c9924d3c408ff3a3191

commit f735bc3d93c4559aef3b2c9924d3c408ff3a3191
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2024-12-08 08:38:09 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2024-12-12 20:56:40 +0000

    Mk/Uses/meson.mk: pass --localstatedir like GNU_CONFIGURE after 9f4546a03cc0

    Meson defaults to --localstatedir=/var/local if --prefix=/usr/local
    but this is not valid for ports/ or FreeBSD hier(7).

    See also 68edbeeaae96 and
    https://github.com/mesonbuild/meson/commit/24549dbed5fe

    PR:             273605
    Analyzed by:    Tatsuki Makino
    Exp-run by:     antoine

 Mk/Uses/meson.mk                  | 1 +
 devel/glib20/Makefile             | 1 -
 devel/libvirt/Makefile            | 7 ++-----
 graphics/colord/Makefile          | 3 +--
 net/netatalk3/Makefile            | 1 -
 ports-mgmt/packagekit/Makefile    | 2 +-
 sysutils/accountsservice/Makefile | 1 -
 sysutils/pacman/Makefile          | 2 +-
 sysutils/polkit/Makefile          | 1 -
 sysutils/upower/Makefile          | 1 -
 x11-fonts/fontconfig/Makefile     | 1 -
 11 files changed, 6 insertions(+), 15 deletions(-)
Comment 9 commit-hook freebsd_committer freebsd_triage 2024-12-12 21:06:21 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=21f9cc3823d8384086ced5988d22bdf49d46c9e5

commit 21f9cc3823d8384086ced5988d22bdf49d46c9e5
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2024-12-12 21:03:53 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2024-12-12 21:03:56 +0000

    audio/pulseaudio: rebuild after f735bc3d93c4 to unbreak system-wide

    PR:             273605

 audio/pulseaudio/Makefile | 1 +
 1 file changed, 1 insertion(+)
Comment 10 Jan Beich freebsd_committer freebsd_triage 2024-12-12 21:07:15 UTC
Similar to bug 199506 I won't mass-bump all consumers. Most affected were already overriding.