[systemd-devel] [PATCH] Delay dbus connection for user session

Kok, Auke-jan H auke-jan.h.kok at intel.com
Tue May 28 13:53:16 PDT 2013


On Tue, May 28, 2013 at 3:00 AM, Chengwei Yang <chengwei.yang at intel.com> wrote:
> Currently, if we have a user session, when systemd user session start,
> just like the situation for it as PID 1, dbus-daemon isn't ready at that
> moment, so it always failed with below error.
>
> Feb 06 16:50:10 localhost.localdomain systemd[417]: Failed to open
> private bus connection: Failed to connect to socket
> /run/user/app/dbus/user_bus_socket: No such file or directory
>
> Signed-off-by: Chengwei Yang <chengwei.yang at intel.com>
> ---
>  src/core/manager.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/core/manager.c b/src/core/manager.c
> index 0508628..467b5ba 100644
> --- a/src/core/manager.c
> +++ b/src/core/manager.c
> @@ -503,7 +503,7 @@ int manager_new(SystemdRunningAs running_as, Manager **_m) {
>                  goto fail;
>
>          /* Try to connect to the busses, if possible. */
> -        r = bus_init(m, running_as != SYSTEMD_SYSTEM);
> +        r = bus_init(m, running_as != SYSTEMD_SYSTEM && running_as != SYSTEMD_USER);
>          if (r < 0)
>                  goto fail;

So, I've looked at this code again as I've spotted this problem over a
year ago, and I'm wondering if this entire section should just be
removed, since running_as only has 2 values (_SYSTEM and _USER)
anyway...

Would there be any objection to just dropping these 4 lines entirely?
Lennart, Kay? I don't see how we'd have a 3rd manager type here.


Auke


More information about the systemd-devel mailing list