accountsservice daemon lacks dbus interfaces

  • Done
  • quality assurance status badge
Details
3 participants
  • L p R n d n
  • Ludovic Courtès
  • Maxim Cournoyer
Owner
unassigned
Submitted by
L p R n d n
Severity
normal
L
L
L p R n d n wrote on 12 May 2020 14:04
(address . bug-guix@gnu.org)
87y2pxwe9n.fsf@lprndn.info
Hello,

The accountsservice service hasn't access to dbus' interfaces throwing
an error when they're needed.The problem, at least, appears with LightDM.
The error looks like:

WARNING: Error updating user /org/freedesktop/Accounts/User1000:
GDBus.Error:org.freedesktop.DBus.Error.InvalidArgs: No such interface
"org.freedesktop.DisplayManager.AccountsService"

For information, it already occured[0] and was resolved[1][2] in NixOS.

After testing, simply wrapping the accountsservice package with relevant
XDG_DATA_DIRS directories as done in the attached patch resolves the
issue. However, there might be a proper solution I'm not aware of.
Also the patch used in [2] doesn't seem to be needed in Guix.

Have a nice day,

L p R n d n

From b9c379d068266c9fdc506f60ff05de3b39346999 Mon Sep 17 00:00:00 2001
From: L p R n d n <guix@lprndn.info>
Date: Tue, 12 May 2020 13:28:47 +0200
Subject: [PATCH] gnu: accountsservice: Wrap program.

* gnu/packages/freedesktop.scm (accountsservice): Add a wrap-program phase
setting XDG_DATA_DIRS to provide dbus interfaces.
---
gnu/packages/freedesktop.scm | 32 +++++++++++++++++++-------------
1 file changed, 19 insertions(+), 13 deletions(-)

Toggle diff (45 lines)
diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index b59d09d15f..01969e03a1 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -1020,19 +1020,25 @@ message bus.")
(("/bin/cat") (which "cat")))
#t))
(add-before
- 'configure 'pre-configure
- (lambda* (#:key inputs #:allow-other-keys)
- ;; Don't try to create /var/lib/AccountsService.
- (substitute* "src/Makefile.in"
- (("\\$\\(MKDIR_P\\).*/lib/AccountsService.*") "true"))
- (let ((shadow (assoc-ref inputs "shadow")))
- (substitute* '("src/user.c" "src/daemon.c")
- (("/usr/sbin/usermod") (string-append shadow "/sbin/usermod"))
- (("/usr/sbin/useradd") (string-append shadow "/sbin/useradd"))
- (("/usr/sbin/userdel") (string-append shadow "/sbin/userdel"))
- (("/usr/bin/passwd") (string-append shadow "/bin/passwd"))
- (("/usr/bin/chage") (string-append shadow "/bin/chage"))))
- #t)))))
+ 'configure 'pre-configure
+ (lambda* (#:key inputs #:allow-other-keys)
+ ;; Don't try to create /var/lib/AccountsService.
+ (substitute* "src/Makefile.in"
+ (("\\$\\(MKDIR_P\\).*/lib/AccountsService.*") "true"))
+ (let ((shadow (assoc-ref inputs "shadow")))
+ (substitute* '("src/user.c" "src/daemon.c")
+ (("/usr/sbin/usermod") (string-append shadow "/sbin/usermod"))
+ (("/usr/sbin/useradd") (string-append shadow "/sbin/useradd"))
+ (("/usr/sbin/userdel") (string-append shadow "/sbin/userdel"))
+ (("/usr/bin/passwd") (string-append shadow "/bin/passwd"))
+ (("/usr/bin/chage") (string-append shadow "/bin/chage"))))
+ #t))
+ (add-after 'install 'wrap-program
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (wrap-program (string-append out "/libexec/accounts-daemon")
+ `("XDG_DATA_DIRS" ":" prefix ("/run/current-system/profile/share")))
+ #t))))))
(native-inputs
`(("glib:bin" ,glib "bin") ; for gdbus-codegen, etc.
("gobject-introspection" ,gobject-introspection)
--
2.26.1
L
L
Ludovic Courtès wrote on 1 Jun 2020 00:01
(name . L p R n d n)(address . guix@lprndn.info)(address . 41207@debbugs.gnu.org)
87367frcgi.fsf@gnu.org
Hello,

L p R n d n <guix@lprndn.info> skribis:

Toggle quote (8 lines)
> The accountsservice service hasn't access to dbus' interfaces throwing
> an error when they're needed.The problem, at least, appears with LightDM.
> The error looks like:
>
> WARNING: Error updating user /org/freedesktop/Accounts/User1000:
> GDBus.Error:org.freedesktop.DBus.Error.InvalidArgs: No such interface
> "org.freedesktop.DisplayManager.AccountsService"

Apparently this error message comes from lightdm, so the issue is that
lightdm doesn’t find the ‘org.freedesktop.Accounts.service’, right?

How is lightdm started? I wonder if there’s something to be done in the
service definition instead.

Thanks,
Ludo’.
L
L
L p R n d n wrote on 2 Jun 2020 16:46
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 41207@debbugs.gnu.org)
87wo4ppltn.fsf@lprndn.info
Hello,

Ludovic Courtès <ludo@gnu.org> writes:

Toggle quote (15 lines)
> Hello,
>
> L p R n d n <guix@lprndn.info> skribis:
>
>> The accountsservice service hasn't access to dbus' interfaces throwing
>> an error when they're needed.The problem, at least, appears with LightDM.
>> The error looks like:
>>
>> WARNING: Error updating user /org/freedesktop/Accounts/User1000:
>> GDBus.Error:org.freedesktop.DBus.Error.InvalidArgs: No such interface
>> "org.freedesktop.DisplayManager.AccountsService"
>
> Apparently this error message comes from lightdm, so the issue is that
> lightdm doesn’t find the ‘org.freedesktop.Accounts.service’, right?

Not exactly, my understanding is that *accountsservice* doesn't find
'org.freedesktop.Accounts.service' which is provided (and asked) by
lightdm. (I think the error comes from accountsservice)

Toggle quote (6 lines)
> How is lightdm started? I wonder if there’s something to be done in the
> service definition instead.
>
> Thanks,
> Ludo’.

Have a nice day,

L p R n d n
L
L
Ludovic Courtès wrote on 3 Jun 2020 11:39
(name . L p R n d n)(address . guix@lprndn.info)(address . 41207@debbugs.gnu.org)
87sgfcpjy2.fsf@gnu.org
Hi,

L p R n d n <guix@lprndn.info> skribis:

Toggle quote (21 lines)
> Ludovic Courtès <ludo@gnu.org> writes:
>
>> Hello,
>>
>> L p R n d n <guix@lprndn.info> skribis:
>>
>>> The accountsservice service hasn't access to dbus' interfaces throwing
>>> an error when they're needed.The problem, at least, appears with LightDM.
>>> The error looks like:
>>>
>>> WARNING: Error updating user /org/freedesktop/Accounts/User1000:
>>> GDBus.Error:org.freedesktop.DBus.Error.InvalidArgs: No such interface
>>> "org.freedesktop.DisplayManager.AccountsService"
>>
>> Apparently this error message comes from lightdm, so the issue is that
>> lightdm doesn’t find the ‘org.freedesktop.Accounts.service’, right?
>
> Not exactly, my understanding is that *accountsservice* doesn't find
> 'org.freedesktop.Accounts.service' which is provided (and asked) by
> lightdm. (I think the error comes from accountsservice)

But see:

Toggle snippet (11 lines)
$ (cd /tmp; tar xf $(guix build -S lightdm))
$ grep -r "Error updating user" /tmp/lightdm-1.30.0/
/tmp/lightdm-1.30.0/common/user-list.c: g_warning ("Error updating user %s: %s", priv->path, error->message);
/tmp/lightdm-1.30.0/common/user-list.c: g_warning ("Error updating user %s: %s", priv->path, error->message);
$ (cd /tmp; tar xf $(guix build -S accountsservice))
$ find /tmp/accountsservice-0.6.50/ -name org.freedesktop\*.service.in
/tmp/accountsservice-0.6.50/data/org.freedesktop.Accounts.service.in
$ find $(guix build accountsservice) -name org.freedesktop\*.service
/gnu/store/l9qyf0brhhq7mwcsyhjsh7k0d3ri3ay2-accountsservice-0.6.50/share/dbus-1/system-services/org.freedesktop.Accounts.service

That’s why I think it’s lightdm (or dbus-daemon?) that fails to find the
.service file.

‘accountsservice-service-type’ extends dbus, such that we have
/etc/dbus-1/system-services/org.freedesktop.Accounts.service. Do you
see this as well?

Thanks,
Ludo’.
L
L
L p R n d n wrote on 3 Jun 2020 14:37
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 41207@debbugs.gnu.org)
87a71k5nq9.fsf@lprndn.info
Hello,

Ludovic Courtès <ludo@gnu.org> writes:

Toggle quote (1 lines)
>>> L p R n d n <guix@lprndn.info> skribis:
[...]
Toggle quote (23 lines)
>> Not exactly, my understanding is that *accountsservice* doesn't find
>> 'org.freedesktop.Accounts.service' which is provided (and asked) by
>> lightdm. (I think the error comes from accountsservice)
>
> But see:
>
> $ (cd /tmp; tar xf $(guix build -S lightdm))
> $ grep -r "Error updating user" /tmp/lightdm-1.30.0/
> /tmp/lightdm-1.30.0/common/user-list.c: g_warning ("Error updating user %s: %s", priv->path, error->message);
> /tmp/lightdm-1.30.0/common/user-list.c: g_warning ("Error updating user %s: %s", priv->path, error->message);
> $ (cd /tmp; tar xf $(guix build -S accountsservice))
> $ find /tmp/accountsservice-0.6.50/ -name org.freedesktop\*.service.in
> /tmp/accountsservice-0.6.50/data/org.freedesktop.Accounts.service.in
> $ find $(guix build accountsservice) -name org.freedesktop\*.service
> /gnu/store/l9qyf0brhhq7mwcsyhjsh7k0d3ri3ay2-accountsservice-0.6.50/share/dbus-1/system-services/org.freedesktop.Accounts.service
>
> That’s why I think it’s lightdm (or dbus-daemon?) that fails to find the
> .service file.
>
> ‘accountsservice-service-type’ extends dbus, such that we have
> /etc/dbus-1/system-services/org.freedesktop.Accounts.service. Do you
> see this as well?

You're right! ;) And probably a dbus-daemon problem from what I
understand. But I really don't know what I'm talking about here...
However, just to clarify, I think it's not that it's not finding
dbus-1/system-services/org.freedesktop.Accounts.service but
dbus-1/interfaces/org.freedesktop.Accounts(.Users?).xml. In that case,
using #:env-variable for the dbus service might be a possibility.
Really, I have quite a lot of files in
/run/current-system/profile/share/dbus-1/interfaces but I don't know what are
their purpose... :/

Toggle quote (3 lines)
> Thanks,
> Ludo’.

Have a nice day,

L p R n d n
L
L
Ludovic Courtès wrote on 11 Jun 2020 12:27
(name . L p R n d n)(address . guix@lprndn.info)(address . 41207@debbugs.gnu.org)
87o8ppc2yi.fsf@gnu.org
Hi,

L p R n d n <guix@lprndn.info> skribis:

Toggle quote (37 lines)
> Ludovic Courtès <ludo@gnu.org> writes:
>
>>>> L p R n d n <guix@lprndn.info> skribis:
> [...]
>>> Not exactly, my understanding is that *accountsservice* doesn't find
>>> 'org.freedesktop.Accounts.service' which is provided (and asked) by
>>> lightdm. (I think the error comes from accountsservice)
>>
>> But see:
>>
>> $ (cd /tmp; tar xf $(guix build -S lightdm))
>> $ grep -r "Error updating user" /tmp/lightdm-1.30.0/
>> /tmp/lightdm-1.30.0/common/user-list.c: g_warning ("Error updating user %s: %s", priv->path, error->message);
>> /tmp/lightdm-1.30.0/common/user-list.c: g_warning ("Error updating user %s: %s", priv->path, error->message);
>> $ (cd /tmp; tar xf $(guix build -S accountsservice))
>> $ find /tmp/accountsservice-0.6.50/ -name org.freedesktop\*.service.in
>> /tmp/accountsservice-0.6.50/data/org.freedesktop.Accounts.service.in
>> $ find $(guix build accountsservice) -name org.freedesktop\*.service
>> /gnu/store/l9qyf0brhhq7mwcsyhjsh7k0d3ri3ay2-accountsservice-0.6.50/share/dbus-1/system-services/org.freedesktop.Accounts.service
>>
>> That’s why I think it’s lightdm (or dbus-daemon?) that fails to find the
>> .service file.
>>
>> ‘accountsservice-service-type’ extends dbus, such that we have
>> /etc/dbus-1/system-services/org.freedesktop.Accounts.service. Do you
>> see this as well?
>
> You're right! ;) And probably a dbus-daemon problem from what I
> understand. But I really don't know what I'm talking about here...
> However, just to clarify, I think it's not that it's not finding
> dbus-1/system-services/org.freedesktop.Accounts.service but
> dbus-1/interfaces/org.freedesktop.Accounts(.Users?).xml. In that case,
> using #:env-variable for the dbus service might be a possibility.
> Really, I have quite a lot of files in
> /run/current-system/profile/share/dbus-1/interfaces but I don't know what are
> their purpose... :/

I think we’d need to look at the lightdm service to further debug this.

It’s not upstream yet, right?

Thanks,
Ludo’.
M
M
Maxim Cournoyer wrote on 30 Jul 2023 15:21
(name . Ludovic Courtès)(address . ludo@gnu.org)
87leexsfex.fsf@gmail.com
Hi,

Ludovic Courtès <ludo@gnu.org> writes:

Toggle quote (47 lines)
> Hi,
>
> L p R n d n <guix@lprndn.info> skribis:
>
>> Ludovic Courtès <ludo@gnu.org> writes:
>>
>>>>> L p R n d n <guix@lprndn.info> skribis:
>> [...]
>>>> Not exactly, my understanding is that *accountsservice* doesn't find
>>>> 'org.freedesktop.Accounts.service' which is provided (and asked) by
>>>> lightdm. (I think the error comes from accountsservice)
>>>
>>> But see:
>>>
>>> $ (cd /tmp; tar xf $(guix build -S lightdm))
>>> $ grep -r "Error updating user" /tmp/lightdm-1.30.0/
>>> /tmp/lightdm-1.30.0/common/user-list.c: g_warning ("Error updating
>>> user %s: %s", priv->path, error->message);
>>> /tmp/lightdm-1.30.0/common/user-list.c: g_warning ("Error updating
>>> user %s: %s", priv->path, error->message);
>>> $ (cd /tmp; tar xf $(guix build -S accountsservice))
>>> $ find /tmp/accountsservice-0.6.50/ -name org.freedesktop\*.service.in
>>> /tmp/accountsservice-0.6.50/data/org.freedesktop.Accounts.service.in
>>> $ find $(guix build accountsservice) -name org.freedesktop\*.service
>>> /gnu/store/l9qyf0brhhq7mwcsyhjsh7k0d3ri3ay2-accountsservice-0.6.50/share/dbus-1/system-services/org.freedesktop.Accounts.service
>>>
>>> That’s why I think it’s lightdm (or dbus-daemon?) that fails to find the
>>> .service file.
>>>
>>> ‘accountsservice-service-type’ extends dbus, such that we have
>>> /etc/dbus-1/system-services/org.freedesktop.Accounts.service. Do you
>>> see this as well?
>>
>> You're right! ;) And probably a dbus-daemon problem from what I
>> understand. But I really don't know what I'm talking about here...
>> However, just to clarify, I think it's not that it's not finding
>> dbus-1/system-services/org.freedesktop.Accounts.service but
>> dbus-1/interfaces/org.freedesktop.Accounts(.Users?).xml. In that case,
>> using #:env-variable for the dbus service might be a possibility.
>> Really, I have quite a lot of files in
>> /run/current-system/profile/share/dbus-1/interfaces but I don't know what are
>> their purpose... :/
>
> I think we’d need to look at the lightdm service to further debug this.
>
> It’s not upstream yet, right?

We now ship a working lightdm service. I believe this bug report was
fixed in 6aeabba2baa11b4a0a778fc353e62d0fe2f6b5ec ("gnu: lightdm: Build
AccountsService files.").

Closing.

--
Thanks,
Maxim
Closed
?