[OE-core] [PATCH v2] pulseaudio: add systemd to PACKAGECONFIG if enabled in DISTRO_FEATURES

Christopher Larson clarson at kergoth.com
Mon Jul 13 16:22:45 UTC 2015


On Mon, Jul 13, 2015 at 9:17 AM, Pau Espin Pedrol <pespin.shar at gmail.com>
wrote:

> Because they are actually a different type of service files (system vs
> user) and they are handled in a different way by systemd. For
> instance, if you check the list of paths in which systemd looks for
> services, you can see that for system services it actually checks
> /lib/systemd/system, but it doesn't for user ones
> (/usr/lib/systemd/user):
>
>
> In systemd, src/shared/path-lookup.c:
>
>                 /* For the user units we include share/ in the search
>                  * path in order to comply with the XDG basedir spec.
>                  * For the system stuff we avoid such nonsense. OTOH
>                  * we include /lib in the search path for the system
>                  * stuff but avoid it for user stuff. */
>
>                 if (running_as == MANAGER_USER) {
>                         if (personal)
>                                 unit_path = user_dirs(generator,
> generator_early, generator_late);
>                         else
>                                 unit_path = strv_new(
>                                         /* If you modify this you also
> want to modify
>                                          * systemduserunitpath= in
> systemd.pc.in, and
>                                          * the arrays in user_dirs()
> above! */
>                                         STRV_IFNOTNULL(generator_early),
>                                         USER_CONFIG_UNIT_PATH,
>                                         "/etc/systemd/user",
>                                         "/run/systemd/user",
>                                         STRV_IFNOTNULL(generator),
>                                         "/usr/local/lib/systemd/user",
>                                         "/usr/local/share/systemd/user",
>                                         USER_DATA_UNIT_PATH,
>                                         "/usr/lib/systemd/user",
>                                         "/usr/share/systemd/user",
>                                         STRV_IFNOTNULL(generator_late),
>                                         NULL);
>                 } else
>                         unit_path = strv_new(
>                                 /* If you modify this you also want to
> modify
>                                  * systemdsystemunitpath= in systemd.pc.in!
> */
>                                 STRV_IFNOTNULL(generator_early),
>                                 SYSTEM_CONFIG_UNIT_PATH,
>                                 "/etc/systemd/system",
>                                 "/run/systemd/system",
>                                 STRV_IFNOTNULL(generator),
>                                 "/usr/local/lib/systemd/system",
>                                 SYSTEM_DATA_UNIT_PATH,
>                                 "/usr/lib/systemd/system",
> #ifdef HAVE_SPLIT_USR
>                                 "/lib/systemd/system",
> #endif
>                                 STRV_IFNOTNULL(generator_late),
>                                 NULL);
>
> And also in systemd, src/core/systemd.pc.in:
>
> systemdsystemunitpath=${systemdsystemconfdir}:/etc/systemd/system:/run/systemd/system:/usr/local/lib/systemd/system:${systemdsystemunitdir}:/usr/lib/systemd/system:/lib/systemd/system
>
> systemduserunitpath=${systemduserconfdir}:/etc/systemd/user:/run/systemd/user:/usr/local/lib/systemd/user:/usr/local/share/systemd/user:${systemduserunitdir}:/usr/lib/systemd/user:/usr/share/systemd/user
>
>
> So, pulseaudio is intended to be used as a systemd user service, not
> as a systemd system service, and that means it needs to end up in
> /usr/lib/systemd/user and not in /lib/systemd/system/.
>
> All these changes are part of my efforts to improve systemd user
> service support in OE, which is kind of bad nowadays imho.
>

Fair enough, thanks for the clarification. Given that systemd user services
require pam, and most embedded distros disable pam, I wonder if we
shouldn’t have an option, at least for daemons in recipes that can handle
it, to switch from user to system via a PACKAGECONFIG, and possibly default
that for the non-pam case.. Hmm.
-- 
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20150713/406be399/attachment-0002.html>


More information about the Openembedded-core mailing list