You are not logged in.

#1 2020-08-19 09:43:00

Jason P.
Member
Registered: 2015-02-26
Posts: 130

[solved] pam fails to find unit dbus-org.freedesktop.home1.service

Hi,

Today after upgrading pam I've started to see log messages like this one:

pam_systemd_home(systemd-user:account): Failed to query user record: Unit dbus-org.freedesktop.home1.service not found.

Worth noting that my home is indeed encrypted but until now I've never seen these messages. sudo operations work perfectly fine.

Nothing to worry then?

➜  $ ~ pacman -Qs pam
local/pam 1.4.0-3
    PAM (Pluggable Authentication Modules) library
local/pambase 20200721.1-2
    Base PAM configuration for services

Last edited by Jason P. (2020-08-19 10:38:17)

Offline

#2 2020-08-19 10:03:21

loqs
Member
Registered: 2014-03-06
Posts: 11,923

Re: [solved] pam fails to find unit dbus-org.freedesktop.home1.service

pambase 20200721.1-2 added systemd-home support.  If the service is not active you will see such a message.
It is not an issue if you if you do not wish to use the service.

Offline

#3 2020-08-19 10:38:01

Jason P.
Member
Registered: 2015-02-26
Posts: 130

Re: [solved] pam fails to find unit dbus-org.freedesktop.home1.service

Thanks for the info loqs.

Aside of that, maybe is a bit noisy throwing errors in such scenarios, when something not enabled by the user will not make any difference in the actual result of the authentication process. It's a misleading message that can potentially make a user think that there's something wrong. But probably this is not the place for a discussion like this hehe.

smile

Offline

#4 2020-08-20 23:31:57

enihcam
Member
From: Internet
Registered: 2009-12-20
Posts: 208

Re: [solved] pam fails to find unit dbus-org.freedesktop.home1.service

How to disable systemd-homed and dbus-org.freedesktop.home1.service?
It's annoying everything I run sudo.

Last edited by enihcam (2020-08-20 23:39:52)

Offline

#5 2020-08-20 23:40:36

loqs
Member
Registered: 2014-03-06
Posts: 11,923

Re: [solved] pam fails to find unit dbus-org.freedesktop.home1.service

enihcam is it enabled on your system or are you just seeing the messages in the journal related to it?

Offline

#6 2020-08-21 09:15:04

Jason P.
Member
Registered: 2015-02-26
Posts: 130

Re: [solved] pam fails to find unit dbus-org.freedesktop.home1.service

I have it disabled, nevertheless I see the error messages.

➜  $ ~ systemctl status systemd-homed.service
● systemd-homed.service - Home Area Manager
     Loaded: loaded (/usr/lib/systemd/system/systemd-homed.service; disabled; vendor preset: enabled)
     Active: inactive (dead)
       Docs: man:systemd-homed.service(8)

Offline

#7 2020-08-21 12:05:55

Al.Piotrowicz
Member
Registered: 2017-08-07
Posts: 87

Re: [solved] pam fails to find unit dbus-org.freedesktop.home1.service

A fast forward question to @loqs: Is it safe to remove the "pam_systemd_home.so" record entries from the pam configuration files for the one doesnt use the "systemd-homed.service" ?

Offline

#8 2020-08-21 13:47:14

loqs
Member
Registered: 2014-03-06
Posts: 11,923

Re: [solved] pam fails to find unit dbus-org.freedesktop.home1.service

Al.Piotrowicz what do you mean by safe?

You could delete /usr/lib/security/pam_systemd_home.so without adjusting the pam stack all the pam_systemd_home.so entries are prefixed with - meaning it is not an error for the module to be missing.

/etc/pam.d/system-auth without pam_systemd_home.so

#%PAM-1.0

auth       required                    pam_faillock.so      preauth
# Optionally use requisite above if you do not want to prompt for the password
# on locked accounts.
auth       [success=1 default=ignore]  pam_unix.so          try_first_pass nullok
auth       [default=die]               pam_faillock.so      authfail
auth       optional                    pam_permit.so
auth       required                    pam_env.so
auth       required                    pam_faillock.so      authsucc
# If you drop the above call to pam_faillock.so the lock will be done also
# on non-consecutive authentication failures.

account    required                    pam_unix.so
account    optional                    pam_permit.so
account    required                    pam_time.so

password   required                    pam_unix.so          try_first_pass nullok shadow
password   optional                    pam_permit.so

session    required                    pam_limits.so
session    required                    pam_unix.so
session    optional                    pam_permit.so

Edit:
pam_unix always checked byefore pam_systemd_home:

#%PAM-1.0

auth       required                    pam_faillock.so      preauth
# Optionally use requisite above if you do not want to prompt for the password
# on locked accounts.
auth       [success=2 default=ignore]  pam_unix.so          try_first_pass nullok
-auth      [success=1 default=ignore]  pam_systemd_home.so
auth       [default=die]               pam_faillock.so      authfail
auth       optional                    pam_permit.so
auth       required                    pam_env.so
auth       required                    pam_faillock.so      authsucc
# If you drop the above call to pam_faillock.so the lock will be done also
# on non-consecutive authentication failures.

account   [success=1 default=ignore]  pam_unix.so
-account    required                    pam_systemd_home.so
account    optional                    pam_permit.so
account    required                    pam_time.so

password  [success=1 default=ignore]  pam_unix.so          try_first_pass nullok shadow
-password   required                    pam_systemd_home.so
password   optional                    pam_permit.so

session    required                    pam_limits.so
session    required                    pam_unix.so
session    optional                    pam_permit.so

Last edited by loqs (2020-08-21 13:54:10)

Offline

#9 2020-08-21 13:55:38

Al.Piotrowicz
Member
Registered: 2017-08-07
Posts: 87

Re: [solved] pam fails to find unit dbus-org.freedesktop.home1.service

Thanks for quick reply, I meant some undesired behaviour by systemd. Im not linux expert and have had plenty of systemd glitches recently so preffered to ask at first. Now it seems clear for me.

Offline

#10 2020-08-21 13:58:33

loqs
Member
Registered: 2014-03-06
Posts: 11,923

Re: [solved] pam fails to find unit dbus-org.freedesktop.home1.service

No the messages you see are because the service is off.  Removing support is returning to the old pambase which did not support pam-systemd-home by default.  So you have already tested the pam stack without pam-systemd-home.

Offline

#11 2020-08-22 14:38:38

cirrus
Member
From: Glasgow Scotland
Registered: 2012-08-24
Posts: 330
Website

Re: [solved] pam fails to find unit dbus-org.freedesktop.home1.service

HI
editing /etc/pam.d/homed-substack like so in conjunction with above edit pam_unix always checked byefore pam_systemd_home: stops the journal errors

#%PAM-1.0

auth      sufficient  pam_unix.so          try_first_pass nullok
-auth      sufficient  pam_systemd_home.so  suspend=true
auth      [success=bad]  pam_permit.so

account   sufficient  pam_unix.so
-account   sufficient  pam_systemd_home.so  suspend=true
account   required    pam_deny.so

Last edited by cirrus (2020-08-22 14:52:10)

Offline

#12 2020-08-24 21:06:20

mokkurkalve
Member
From: Bergen, Norway
Registered: 2009-08-29
Posts: 31

Re: [solved] pam fails to find unit dbus-org.freedesktop.home1.service

Yes, that stopped the incessant spamming of the logs with the message "Failed to query user record: Unit dbus-org.freedesktop.home1.service not found."
It is still triggered whenever there's a authentication problem, like when you type the password wrong when using sudo or in the Mate lock-screen.
That's is not a problem though, as it's not happening that often. However, as I am never going to enable systemd-homed.service the message is completely unneeded, but there you go....


"ONLY THOSE WHO ATTEMPT THE IMPOSSIBLE WILL ACHIEVE THE ABSURD"
- Oceania Association of Autonomous Astronauts

Offline

#13 2020-08-24 21:10:49

loqs
Member
Registered: 2014-03-06
Posts: 11,923

Re: [solved] pam fails to find unit dbus-org.freedesktop.home1.service

The proposed fix from https://github.com/systemd/systemd/issues/16813 might stop the message being produced.  I have not tried it.
Edit:
Changes the message to

pam_systemd_home(systemd-user:account): systemd-homed is not available: Unit dbus-org.freedesktop.home1.service not found.

Edit2:
Updated system-auth only call pam_systemd_homed if the account is managed by it due to https://bugs.archlinux.org/task/65819#comment192113

#%PAM-1.0

auth       required                    pam_faillock.so      preauth
# Optionally use requisite above if you do not want to prompt for the password
# on locked accounts.
auth       [success=2 default=ignore]  pam_unix.so          try_first_pass nullok
-auth      [success=1 default=ignore]  pam_systemd_home.so
auth       [default=die]               pam_faillock.so      authfail
auth       optional                    pam_permit.so
auth       required                    pam_env.so
auth       required                    pam_faillock.so      authsucc
# If you drop the above call to pam_faillock.so the lock will be done also
# on non-consecutive authentication failures.

account    [default=1 success=ignore]  pam_succeed_if.so    quiet uid >= 60001 uid <= 60513
-account   [success=1 default=ignore]  pam_systemd_home.so
account    required                    pam_unix.so
account    optional                    pam_permit.so
account    required                    pam_time.so

password   [default=1 success=ignore]  pam_succeed_if.so    quiet uid >= 60001 uid <= 60513
-password  [success=1 default=ignore]  pam_systemd_home.so
password   required                    pam_unix.so          try_first_pass nullok shadow
password   optional                    pam_permit.so

session    required                    pam_limits.so
session    required                    pam_unix.so
session    [default=1 success=ignore]  pam_succeed_if.so    quiet uid >= 60001 uid <= 60513
-session   required                    pam_systemd_home.so
session    optional                    pam_permit.so

Last edited by loqs (2020-08-27 04:38:45)

Offline

#14 2020-08-27 11:02:14

mokkurkalve
Member
From: Bergen, Norway
Registered: 2009-08-29
Posts: 31

Re: [solved] pam fails to find unit dbus-org.freedesktop.home1.service

"Edit2" seems to work. The message is still triggered when a password is typed wrong, but I guess that is unavoidable. PAM goes through the list of modules in such a scenario I guess....?


"ONLY THOSE WHO ATTEMPT THE IMPOSSIBLE WILL ACHIEVE THE ABSURD"
- Oceania Association of Autonomous Astronauts

Offline

#15 2020-08-27 11:25:30

loqs
Member
Registered: 2014-03-06
Posts: 11,923

Re: [solved] pam fails to find unit dbus-org.freedesktop.home1.service

As pointed out https://bugs.archlinux.org/task/65819#comment192124 the range of UIDs used by systemd-home is not guaranteed to be in that range.
My edit from post #8 where pam_systemd_home is removed should achieve the result you desire.

Last edited by loqs (2020-08-27 12:00:10)

Offline

#16 2020-09-20 19:46:18

ghen
Member
From: Belgium
Registered: 2010-08-31
Posts: 101

Re: [solved] pam fails to find unit dbus-org.freedesktop.home1.service

Still seeing this as well, on several "standard" installations not using systemd-homed (and not intending to).
I've seen several proposed solutions/workarounds here and in FS#65819, which one is recommended now?

Offline

#17 2020-09-20 19:56:47

loqs
Member
Registered: 2014-03-06
Posts: 11,923

Re: [solved] pam fails to find unit dbus-org.freedesktop.home1.service

None of the solutions in https://bugs.archlinux.org/task/65819 will stop the extra messages.

Th easiest solution is perhaps to use NoExtract

NoExtract=usr/lib/security/pam_systemd_home.so

Then reinstall systemd.
This works because all the pam_systemd_home entries in /etc/pam.d/system-auth are prefixed with a - while prevents failure to load the module being an error.

If you want to edit the pam configs the first solution from post #8.

Last edited by loqs (2020-09-20 20:17:48)

Offline

#18 2020-09-20 20:17:27

ghen
Member
From: Belgium
Registered: 2010-08-31
Posts: 101

Re: [solved] pam fails to find unit dbus-org.freedesktop.home1.service

Thanks.
So the default config will keep this "bug" ?

Offline

#19 2020-09-20 20:22:42

loqs
Member
Registered: 2014-03-06
Posts: 11,923

Re: [solved] pam fails to find unit dbus-org.freedesktop.home1.service

I expect so.

Offline

#20 2020-09-20 20:30:10

ghen
Member
From: Belgium
Registered: 2010-08-31
Posts: 101

Re: [solved] pam fails to find unit dbus-org.freedesktop.home1.service

Still reading up on systemd-homed (and so far I think I'll stay far away from it), but is simply enabling and ignoring it a solution as well?  Or will it eat my kittens if I do?

Offline

#21 2020-09-20 20:39:25

loqs
Member
Registered: 2014-03-06
Posts: 11,923

Re: [solved] pam fails to find unit dbus-org.freedesktop.home1.service

ghen wrote:

Still reading up on systemd-homed (and so far I think I'll stay far away from it), but is simply enabling and ignoring it a solution as well?

Yes as the messages are caused by the service not being active.

Offline

Board footer

Powered by FluxBB