[pulseaudio-tickets] [PulseAudio] #315: ./pulse hidden directory
PulseAudio
trac-noreply at tango.0pointer.de
Sat Jun 28 04:09:54 PDT 2008
#315: ./pulse hidden directory
---------------------+------------------------------------------------------
Reporter: gohanz | Owner: lennart
Type: defect | Status: new
Priority: normal | Milestone:
Component: daemon | Severity: normal
Resolution: | Keywords:
---------------------+------------------------------------------------------
Comment (by coling):
Judging by what you say, it sounds suspiciously like certain environment
variables are not set when starting pulse at boot. Normally pulse will
create a {{{.pulse}}} folder in {{{$HOME}}}. I suspect this is not set at
boot but once you login to restart the service, it is indeed set.
When starting in system wide mode, the daemon should drop privs to the
{{{pulse}}} user and then create the {{{.pulse}}} dir. However, the code
(at least in 0.9.10) explicitly uses a precompiled path, not the runtime
path and issues a warning if the two do not match.
As {{{--system}}} is specified on the command line it should be hitting
this pre-defined code path and never using the runtime stuff so this is
pretty damn confusing.
So I don't think it's the daemon bit of the code that is doing this, but
it's not to say it's not created when the daemon starts up. I suspect
another codepath is present (probably when opening the config file or
something) that also tries to create this same folder but it does not have
use the same way of determining it....
Ahhhhh yes. here it is:
[http://git.0pointer.de/?p=pulseaudio.git;a=blob;f=src/pulsecore/core-
util.c;h=61d04c2d730e4a3d7933d551ac04630106f7cfe1;hb=tags/release-0.9.10#l1136
core-util.c line 1136]
This in turn uses {{{pa_get_home_dir()}}} to get the home directory. I'd
place money on this being {{{/}}} at the time it's run.
It seems that when the daemon is started, it calls
{{{pa_daemon_conf_load()}}}
[http://git.0pointer.de/?p=pulseaudio.git;a=blob;f=src/daemon/main.c;h=6b0c81daf3686726f51ccd2742e6bea9be05ff73;hb=tags/release-0.9.10#l398
here]. This is before {{{change_user()}}} is called which in turn sets the
{{{PULSE_CONFIG_PATH}}} env var which in turn would have prevented
{{{pa_get_home_dir()}}} from returning {{{/}}}...
Phew!
OK, now that I think I've found the problem, how to fix it!! The hacky way
is to make sure your init script does {{{export HOME=/var/run/pulse}}} (or
whatever the pulse user's home dir is on your system) before starting
pulse. For the less hacky solution, I'll have to ask Lennart about this as
I don't really know all the background to this code :)
--
Ticket URL: <http://www.pulseaudio.org/ticket/315#comment:3>
PulseAudio <http://pulseaudio.org/>
The PulseAudio Sound Server
More information about the pulseaudio-bugs
mailing list