<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 13, 2015 at 9:17 AM, Pau Espin Pedrol <span dir="ltr">&lt;<a href="mailto:pespin.shar@gmail.com" target="_blank">pespin.shar@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":3a" class="a3s" style="overflow:hidden">Because they are actually a different type of service files (system vs<br>
user) and they are handled in a different way by systemd. For<br>
instance, if you check the list of paths in which systemd looks for<br>
services, you can see that for system services it actually checks<br>
/lib/systemd/system, but it doesn&#39;t for user ones<br>
(/usr/lib/systemd/user):<br>
<br>
<br>
In systemd, src/shared/path-lookup.c:<br>
<br>
                /* For the user units we include share/ in the search<br>
                 * path in order to comply with the XDG basedir spec.<br>
                 * For the system stuff we avoid such nonsense. OTOH<br>
                 * we include /lib in the search path for the system<br>
                 * stuff but avoid it for user stuff. */<br>
<br>
                if (running_as == MANAGER_USER) {<br>
                        if (personal)<br>
                                unit_path = user_dirs(generator,<br>
generator_early, generator_late);<br>
                        else<br>
                                unit_path = strv_new(<br>
                                        /* If you modify this you also<br>
want to modify<br>
                                         * systemduserunitpath= in<br>
<a href="http://systemd.pc.in" rel="noreferrer" target="_blank">systemd.pc.in</a>, and<br>
                                         * the arrays in user_dirs() above! */<br>
                                        STRV_IFNOTNULL(generator_early),<br>
                                        USER_CONFIG_UNIT_PATH,<br>
                                        &quot;/etc/systemd/user&quot;,<br>
                                        &quot;/run/systemd/user&quot;,<br>
                                        STRV_IFNOTNULL(generator),<br>
                                        &quot;/usr/local/lib/systemd/user&quot;,<br>
                                        &quot;/usr/local/share/systemd/user&quot;,<br>
                                        USER_DATA_UNIT_PATH,<br>
                                        &quot;/usr/lib/systemd/user&quot;,<br>
                                        &quot;/usr/share/systemd/user&quot;,<br>
                                        STRV_IFNOTNULL(generator_late),<br>
                                        NULL);<br>
                } else<br>
                        unit_path = strv_new(<br>
                                /* If you modify this you also want to modify<br>
                                 * systemdsystemunitpath= in <a href="http://systemd.pc.in" rel="noreferrer" target="_blank">systemd.pc.in</a>! */<br>
                                STRV_IFNOTNULL(generator_early),<br>
                                SYSTEM_CONFIG_UNIT_PATH,<br>
                                &quot;/etc/systemd/system&quot;,<br>
                                &quot;/run/systemd/system&quot;,<br>
                                STRV_IFNOTNULL(generator),<br>
                                &quot;/usr/local/lib/systemd/system&quot;,<br>
                                SYSTEM_DATA_UNIT_PATH,<br>
                                &quot;/usr/lib/systemd/system&quot;,<br>
#ifdef HAVE_SPLIT_USR<br>
                                &quot;/lib/systemd/system&quot;,<br>
#endif<br>
                                STRV_IFNOTNULL(generator_late),<br>
                                NULL);<br>
<br>
And also in systemd, src/core/<a href="http://systemd.pc.in" rel="noreferrer" target="_blank">systemd.pc.in</a>:<br>
systemdsystemunitpath=${systemdsystemconfdir}:/etc/systemd/system:/run/systemd/system:/usr/local/lib/systemd/system:${systemdsystemunitdir}:/usr/lib/systemd/system:/lib/systemd/system<br>
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<br>
<br>
<br>
So, pulseaudio is intended to be used as a systemd user service, not<br>
as a systemd system service, and that means it needs to end up in<br>
/usr/lib/systemd/user and not in /lib/systemd/system/.<br>
<br>
All these changes are part of my efforts to improve systemd user<br>
service support in OE, which is kind of bad nowadays imho.</div></blockquote></div><br>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.<br>-- <br><div class="gmail_signature">Christopher Larson<br>clarson at kergoth dot com<br>Founder - BitBake, OpenEmbedded, OpenZaurus<br>Maintainer - Tslib<br>Senior Software Engineer, Mentor Graphics</div>
</div></div>