You are not logged in.

#1 2023-06-27 22:30:38

johnlumby
Member
Registered: 2023-06-27
Posts: 3

[SOLVED] sysV init system, pacman -Syu, non-root user login fails

My system runs the sysv init from the kernel command line.
So systemd does not run (at boot time).
until most recent pacman -Syu on 5 June,  root and non-root users could log in.
But after pacman -Syu on that day,     at some unpredictable point after system boot,   non-root users could not login.
on their console was displayed
                 Assertion 'close_nointr(fd) != -EBADF' failed at src/basic/fd-util.c:74, function safe_close(). Aborting.
which is apparently in some systemd routine.

I have seen this exact message mentioned in other arch posts but none appear relevant to my situation.

One additional fact  -  on a different but quite similar arch system,   where most recent pacman -Syu was on 16 April,
non-root users can log in.   So "something changed" in either systemd or pam between 16 April - 5 June
which is apparently incompatible with a sysv init setup  -  probably not running systemd as the init manager.

After trying unsuccessfully to overcome this via various pam configuration changes,
(but I don't know enough about pam to be confident I tried the right things)
I have devised a horrible workaround which is good enough for me.  However my purpose in posting this is to ask
if there is some way to configure pam and/or systemd or the systemd-log infrastructure which would either
omit all systemd login processing or at least avoid or catch and ignore whatever src/basic/fd-util.c:74
is trying to do.      I would welcome any and all advice.
An informed answer of "no there isn't" would be fine if that is the case.

Why my system uses sysv init and not systemd is something I would be happy to talk about offline
but not really relevant here.

Cheers,   John

Last edited by johnlumby (2023-06-28 15:25:43)

Offline

#2 2023-06-27 22:37:03

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,358
Website

Re: [SOLVED] sysV init system, pacman -Syu, non-root user login fails

Mod note: moving to AUR Issues


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#3 2023-06-27 22:40:36

loqs
Member
Registered: 2014-03-06
Posts: 18,817

Re: [SOLVED] sysV init system, pacman -Syu, non-root user login fails

What is this horrible workaround?
Have you tried https://bbs.archlinux.org/viewtopic.php … 6#p2101806 but applying it to all pam modules supplied by systemd?

Offline

#4 2023-06-28 02:26:16

johnlumby
Member
Registered: 2023-06-27
Posts: 3

Re: [SOLVED] sysV init system, pacman -Syu, non-root user login fails

loqs wrote:

What is this horrible workaround?

in outline
      .    build a modified login executable which bypasses the various pam login calls when -f force is specified
      .    add lines to inittab to autologin (in the getty sense) two most-needed non-root users at specified unusual ttys ,   specifying the modified login executable

Yes,   horribly insecure in general,   but unlikely to be exploited in my particular situation.     Also can be expected to survive future upgrades without need for any change.

loqs wrote:

Have you tried https://bbs.archlinux.org/viewtopic.php … 6#p2101806 but applying it to all pam modules supplied by systemd?

No,     thanks for the suggestion,  I shall look into that,    but it seems to require more knowledge of pam than I really have.

Offline

#5 2023-06-28 10:34:09

loqs
Member
Registered: 2014-03-06
Posts: 18,817

Re: [SOLVED] sysV init system, pacman -Syu, non-root user login fails

$ pacman -Ql systemd | grep usr/lib/security # Find pam modules supplied by systemd
systemd /usr/lib/security/
systemd /usr/lib/security/pam_systemd.so
systemd /usr/lib/security/pam_systemd_home.so
$ grep -rF pam_systemd.so /etc/pam.d/ # check every line using the module starts with a - meaning it can be deleted
/etc/pam.d/system-login:-session   optional   pam_systemd.so
$ grep -rF pam_systemd_home.so /etc/pam.d/  # check every line using the module starts with a - meaning it can be deleted
/etc/pam.d/system-auth:-auth      [success=2 default=ignore]  pam_systemd_home.so
/etc/pam.d/system-auth:-account   [success=1 default=ignore]  pam_systemd_home.so
/etc/pam.d/system-auth:-password  [success=1 default=ignore]  pam_systemd_home.so
/etc/pam.d/system-auth:-session   optional                    pam_systemd_home.so

Assuming the checks above passed,  from a root shell

# rm /usr/lib/security/pam_systemd.so
# rm /usr/lib/security/pam_systemd_home.so

On a different tty check you can still login as root and if you can login as a normal user without your hack.
If not reinstall the systemd package.  If so add the two pam modules supplied by systemd as NoExtract entries in pacman.conf.

Offline

#6 2023-06-28 12:49:18

johnlumby
Member
Registered: 2023-06-27
Posts: 3

Re: [SOLVED] sysV init system, pacman -Syu, non-root user login fails

loqs wrote:
 [ ... ] 

On a different tty check you can still login as root and if you can login as a normal user without your hack.

I followed those commands exactly without really understanding them and they produced the same result as yours,
which was much easier than I had anticipated,    and yes,    I can now log in normally as root and as non-root on regular ttys.
Thank-you very much.

loqs wrote:

If so add the two pam modules supplied by systemd as NoExtract entries in pacman.conf.

done

Offline

#7 2023-06-28 14:35:57

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,601

Re: [SOLVED] sysV init system, pacman -Syu, non-root user login fails

Two things.  If this is solved, please edit your title by editing your first post and prepend [SOLVED] to your title.  You may have to shorten/edit your title to get it to fit.

Second, there is an opportunity to learn here.  You say you followed the commands without really understanding them.  This would be an excellent opportunity to dig into the man pages for the commands, pick apart those commands, and understand why they did what they did.  Don't just take the fish, learn to fish. wink


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

Board footer

Powered by FluxBB