[pulseaudio-discuss] [PATCH 6/8] launch: Add systemd units for launching pulseaudio user instances

Colin Guthrie gmane at colin.guthr.ie
Mon Nov 10 08:55:02 PST 2014


Tanu Kaskinen wrote on 10/11/14 16:29:
> On Mon, 2014-11-10 at 16:13 +0000, Colin Guthrie wrote:
>> Tanu Kaskinen wrote on 10/11/14 15:49:
>>> Hi Colin,
>>>
>>> While I was adding systemd .service and .socket files for the system
>>> mode in Tizen, I noticed something in configure.ac that I didn't pay
>>> attention to before...
>>>
>>> On Mon, 2014-11-03 at 09:42 +0000, Colin Guthrie wrote:
>>>> ---
>>>>  configure.ac                                  | 11 +++++++++++
>>>>  src/Makefile.am                               | 12 +++++++++++-
>>>>  src/daemon/systemd/user/pulseaudio.service.in | 10 ++++++++++
>>>>  src/daemon/systemd/user/pulseaudio.socket     | 10 ++++++++++
>>>>  4 files changed, 42 insertions(+), 1 deletion(-)
>>>>  create mode 100644 src/daemon/systemd/user/pulseaudio.service.in
>>>>  create mode 100644 src/daemon/systemd/user/pulseaudio.socket
>>>>
>>>> diff --git a/configure.ac b/configure.ac
>>>> index 25cb207..23905ad 100644
>>>> --- a/configure.ac
>>>> +++ b/configure.ac
>>>> @@ -1203,6 +1203,13 @@ AS_IF([test "x$HAVE_SYSTEMD" = "x1"],
>>>>          HAVE_SYSTEMD_JOURNAL=1
>>>>      ])
>>>>  
>>>> +AC_ARG_WITH([systemduserunitdir],
>>>> +        AS_HELP_STRING([--with-systemduserunitdir=DIR], [Directory for systemd user service files]),
>>>> +        [], [with_systemduserunitdir=$($PKG_CONFIG --variable=systemduserunitdir systemd)])
>>>> +if test "x$with_systemduserunitdir" != xno; then
>>>> +        AC_SUBST([systemduserunitdir], [$with_systemduserunitdir])
>>>> +fi
>>>
>>> Is it really a good idea to use pkg-config to get the unit directory?
>>> pkg-config will probably return /usr/lib/systemd/system, while we should
>>> by default install under /usr/local to avoid overwriting distro files.
>>
>> It'll usually say /usr/lib/systemd/user (not system) but yes, this is
>> pretty much the same as the udevrules dir.
>>
>> Installing into /usr/local/ would be pretty weird tho' as they just
>> wouldn't work there (which would be especially odd if you didn't have a
>> system-installed version of PA). This is the same logic with the
>> udevrulesdir I guess.
>>
>> So I'd say that using pkgconfig to get the value is just as sensible as
>> the hard-coded /lib/udev/rules.d/ stuff that's in there currently.
> 
> Are you sure installing to /usr/local/lib/systemd/user doesn't work? To
> me path-lookup.c looks like it includes /usr/local/lib/systemd/user in
> the unit search paths.

Hmm, yeah looks like it. It's not documented in the documentation tho',
(I was looking through through "man systemd.unit" which describes all
the paths) and I've not not seen this behaviour in other projects that
support this pkgconfig stuff (and I've seen a fair few when packaging
stuff downstream), so with combined with the fact that this is how
pretty much everything else does things and the fact that the udev rules
already work like this, I don't really fancy introducing something off
the beaten path here, but if you do feel strongly, I can certainly look
into it.

Col


-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/


More information about the pulseaudio-discuss mailing list