You are not logged in.

#1 2020-12-06 16:46:02

jimipatoune
Member
Registered: 2020-12-06
Posts: 3

[Solved] Sway, pam & systemd-homed

Hey, I have the same problem than https://bbs.archlinux.org/viewtopic.php?id=258297

tl;dr the issue is that any time I run sudo, this happens :

Dec 06 17:02:11 archpatoune sudo[1504]: pam_unix(sudo:session): session closed for user root
Dec 06 17:02:13 archpatoune sudo[1546]: pam_systemd_home(sudo:account): systemd-homed is not available: Unit dbus-org.freedesktop.home1.service not found.
Dec 06 17:02:13 archpatoune sudo[1546]:     jimi : TTY=tty1 ; PWD=/home/jimi ; USER=root ; COMMAND=/usr/bin/journalctl
Dec 06 17:02:13 archpatoune sudo[1546]: pam_unix(sudo:session): session opened for user root(uid=0) by jimi(uid=1000)
...

I think it started a few month ago when homed was updated, but I didn't mind until I realized that my journalctl log grew to +3GiB in a few weeks and the CPU consumption of journalctl was about 100% of one core all the time. Meh. Did I run that many sudo ?

So after some investigation, it seems that Sway is requiring a root login every ~2 seconds. That's why the log grew so big. But... why ? I tried with Weston as a comparison, the problem does not appear, so it's sway-related.
Is it the normal behavior of Sway ?

If so, how can I disable the error message to avoid the log growing to big ? I tried to enable homed service, and it just changes the error message to something else. The new message basically the same but complaining that jimi user is not managed by homed instead. I'm not sure I want to change this.

If it's not normal, I don't know where to start looking to find the issue in Sway. hmm

Help is welcome! Thanks


EDIT -- SOLUTION --
1) Changed the pam config to make pam_unix come before 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

2) Removed all the call to sudo X from my swaybar config because the would run every frame -_-

Last edited by jimipatoune (2020-12-12 13:10:25)

Offline

#2 2020-12-06 18:32:34

GaKu999
Member
From: US/Eastern
Registered: 2020-06-21
Posts: 696

Re: [Solved] Sway, pam & systemd-homed

I just enabled systemd-homed, it reduces the spam.

Another solution is, opt-out from systemd-homed if you do not plan usages for it.
Disable,mask and remove the refs from the pam configs.

...

Do you know how to work with the pam configs without breaking your login right?


My reposSome snippets

Heisenberg might have been here.

Offline

#3 2020-12-07 14:37:55

jimipatoune
Member
Registered: 2020-12-06
Posts: 3

Re: [Solved] Sway, pam & systemd-homed

No ! Is there enough info on the wiki ? Otherwise help is welcome smile

Offline

#4 2020-12-12 12:18:25

jimipatoune
Member
Registered: 2020-12-06
Posts: 3

Re: [Solved] Sway, pam & systemd-homed

I managed to fix the homed error message itself but the spam continues.

    jimi : TTY=tty1 ; PWD=/home/jimi : USER=root ; COMMAND=/usr/bin/journalctl
pam_unix(sudo:session): session opened for user root(uid=0) by jimi (uid=1000)
pam_unix(sudo:session): session closed for user root

every ~1-2 seconds while Sway is open. So It's a Sway issue (or at least, odd behavior), apparently.

I'll ask around Sway's community but if anyone here had this let me know!

EDIT : It was an issue with my swaybar config lol for some reason it used sudo journalctl to get infos. Every frames. hum.

Anyway that's solved now!

Last edited by jimipatoune (2020-12-12 13:07:53)

Offline

#5 2020-12-12 14:34:00

merlock
Member
Registered: 2018-10-30
Posts: 262

Re: [Solved] Sway, pam & systemd-homed

jimipatoune wrote:

EDIT : It was an issue with my swaybar config lol for some reason it used sudo journalctl to get infos. Every frames. hum.

Unless your user is a member of the `systemd-journal` group, to get info (other than user info) from the journal, you'll need sudo.


Eenie meenie, chili beanie, the spirits are about to speak -- Bullwinkle J. Moose
It's a big club...and you ain't in it -- George Carlin
Registered Linux user #149839
perl -e 'print$i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10); '

Offline

Board footer

Powered by FluxBB