You are not logged in.

#1 2021-07-20 18:31:45

Vlou
Member
Registered: 2021-07-20
Posts: 5

[SOLVED] Instant logout after login, consequently to a full upgrade

Hi everyone,
I'm an archlinux GNOME user.
Yesterday evening, as usual for 2 years now, I upgraded my packages ("paru -Syu && poweroff").
Everything went fine, pacman logs are here :  https://pastebin.com/6ifTuuix
But after a reboot, today morning I can't login. To be more specific, I can login, but I'm instantly logged out !

Here are the logs when I try to login with the user named "test" with GDM.
After hitting Enter, I'm kicked back to the login page of GDM. Logs are here : https://pastebin.com/vdjeukvY

Then, I tried with TTY2. And the same thing appears : after a successful login with the "test" user, I'm kicked back to the login prompt.
Logs are here : https://pastebin.com/07iqQaSR

This "test" account is not disabled, and its shell is /bin/bash. It has no .bashrc specific configuration, it is a brand new account that I created after discovering the issue. Here is the /etc/passwd extract : "test:x:1002:1003::/home/test:/bin/bash".
I never touched /etc/profile or /etc/profile.d.
I can't neither login with the "root" account or my personal user "valentin".
Full journalctl logs of the boot when I tried to login using GDM and TTY2 are here : https://pastebin.com/x8UhbMsK

To investigate further, i started my computer in "single" mode, and could log in with the root account. Then, I disabled pam_nologin (by deleting /var/run/nologin) to enable user login, and started sshd.
I had the same login / instant logout behavior when I tried to connect using SSH with the following command : "ssh test@192.168.1.228". Logs are here : https://pastebin.com/ZvFVtC1P
However, I could successfully launch individual commands, for example "ssh test@192.168.1.228 whoami".
I could even get a normal shell with "ssh test@192.168.1.228 -t zsh"

With this SSH shell, I upgraded my packages again, and tried to reinstall all PAM related packages and gdm, But it changed nothing. I tried to start with the LTS kernel, but it changed nothing neither.
Do someone have a clue about what causes this instant logout thing, and how to solve this problem ? What drives me crazy is that I can't see evident errors in the logs...

EDIT : Solved, see the last post !

Thanks in advance,
Valentin

Last edited by Vlou (2021-07-21 02:25:33)

Offline

#2 2021-07-20 18:48:52

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,466

Re: [SOLVED] Instant logout after login, consequently to a full upgrade

Why do you say the test account is using zsh?
/etc/passwd suggests bash instead.
Maybe it is bash and not zsh the source of the troubles?
Logs say:

Received disconnect from 192.168.1.242 port 39602:11: disconnected by user

So i'd  look better for autostarted commands (?)

Last edited by kokoko3k (2021-07-20 18:57:00)


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#3 2021-07-20 18:57:35

Vlou
Member
Registered: 2021-07-20
Posts: 5

Re: [SOLVED] Instant logout after login, consequently to a full upgrade

kokoko3k wrote:

Why you say the test account is using zsh?
/etc/passwd suggests bash instead.
Anyway, logs say:

Received disconnect from 192.168.1.242 port 39602:11: disconnected by user

So i'd  look better for autostarted commands (?)

"test" account is using bash by default, my mistake. But i tried with those two shells, and the same thing appears.

By "autostarted" commands, you mean .bashrc, or systemctl enabled services ? I do not think it is .bashrc related because this strange behavior happens for all users.
I didn't understand why there is "disconnected by user" in logs... It is usually what happens when I voluntarily exit the shell.

Last edited by Vlou (2021-07-20 19:03:55)

Offline

#4 2021-07-20 20:17:42

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,431

Re: [SOLVED] Instant logout after login, consequently to a full upgrade

The only package in the update susceptible to cause this is systemd, however:

pacman -Qikk filesystem bash zsh
cat /etc/shells

Offline

#5 2021-07-21 00:53:58

Vlou
Member
Registered: 2021-07-20
Posts: 5

Re: [SOLVED] Instant logout after login, consequently to a full upgrade

seth wrote:

The only package in the update susceptible to cause this is systemd, however:

pacman -Qikk filesystem bash zsh
cat /etc/shells
[root@dell-5490-arch valentin]# pacman -Qikk filesystem bash zsh
Name            : filesystem
Version         : 2021.05.31-1
Description     : Base Arch Linux files
Architecture    : x86_64
URL             : https://archlinux.org
Licenses        : GPL
Groups          : None
Provides        : None
Depends On      : iana-etc
Optional Deps   : None
Required By     : fakeroot  glibc  mkinitcpio
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 31.67 KiB
Packager        : S
Build Date      : Sun May 30 20:39:56 2021
Install Date    : Fri Jun 11 12:31:42 2021
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : Signature

backup file: filesystem: /etc/crypttab (Modification time mismatch)
backup file: filesystem: /etc/crypttab (Size mismatch)
backup file: filesystem: /etc/crypttab (MD5 checksum mismatch)
backup file: filesystem: /etc/crypttab (SHA256 checksum mismatch)
backup file: filesystem: /etc/fstab (Modification time mismatch)
backup file: filesystem: /etc/fstab (Size mismatch)
backup file: filesystem: /etc/fstab (MD5 checksum mismatch)
backup file: filesystem: /etc/fstab (SHA256 checksum mismatch)
backup file: filesystem: /etc/group (Modification time mismatch)
backup file: filesystem: /etc/group (Size mismatch)
backup file: filesystem: /etc/group (MD5 checksum mismatch)
backup file: filesystem: /etc/group (SHA256 checksum mismatch)
backup file: filesystem: /etc/gshadow (Modification time mismatch)
backup file: filesystem: /etc/gshadow (Size mismatch)
backup file: filesystem: /etc/gshadow (MD5 checksum mismatch)
backup file: filesystem: /etc/gshadow (SHA256 checksum mismatch)
backup file: filesystem: /etc/hosts (Modification time mismatch)
backup file: filesystem: /etc/hosts (Size mismatch)
backup file: filesystem: /etc/hosts (MD5 checksum mismatch)
backup file: filesystem: /etc/hosts (SHA256 checksum mismatch)
backup file: filesystem: /etc/passwd (Modification time mismatch)
backup file: filesystem: /etc/passwd (Size mismatch)
backup file: filesystem: /etc/passwd (MD5 checksum mismatch)
backup file: filesystem: /etc/passwd (SHA256 checksum mismatch)
warning: filesystem: /etc/resolv.conf (File type mismatch)
backup file: filesystem: /etc/shadow (Modification time mismatch)
backup file: filesystem: /etc/shadow (Size mismatch)
backup file: filesystem: /etc/shadow (MD5 checksum mismatch)
backup file: filesystem: /etc/shadow (SHA256 checksum mismatch)
backup file: filesystem: /etc/shells (Modification time mismatch)
backup file: filesystem: /etc/shells (Size mismatch)
backup file: filesystem: /etc/shells (MD5 checksum mismatch)
backup file: filesystem: /etc/shells (SHA256 checksum mismatch)
filesystem: 118 total files, 1 altered file
Name            : bash
Version         : 5.1.008-1
Description     : The GNU Bourne Again shell
Architecture    : x86_64
URL             : https://www.gnu.org/software/bash/bash.html
Licenses        : GPL
Groups          : None
Provides        : sh
Depends On      : readline  libreadline.so=8-64  glibc  ncurses
Optional Deps   : bash-completion: for tab completion [installed]
Required By     : acpid  ant  arch-install-scripts  asp  atop  autoconf  automake  bash-completion  bind  bison  bzip2  ca-certificates-utils  cpupower  db  dhcpcd  dialog  diffutils  dkms  e2fsprogs  ebtables  fakeroot  fftw  findutils
                  fio  flex  foomatic-db-engine  freetype2  fzf  gawk  gdbm  gettext  gmp  gpm  gradle  grub  gzip  i8kutils  icu  ijs  iptables  java-runtime-common  jdownloader2  js78  keyutils  laptop-mode-tools  lib32-libltdl  libdca
                  libgpg-error  libksba  libmbim  libnet  liboggz  libpaper  libpcap  libpng  libreoffice-fresh  libteam  libtool  libusb-compat  lsb-release  lvm2  m4  man-db  maven  mbedtls  mkinitcpio  mono  mtools  nano  neofetch
                  npth  nspr  nss  openresolv  os-prober  p7zip  pacman  pcre  pcre2  pdftk  pkgconf  plantuml  radare2  rpcbind  rpmextract  sane  sgml-common  smartmontools  source-highlight  systemd  texinfo  tor  unzip  vde2
                  vte-common  which  wireguard-tools  wireless-regdb  wqy-zenhei  xdg-user-dirs  xdg-utils  xfsprogs  xz
Optional For    : hdparm  ncurses  vim-runtime
Conflicts With  : None
Replaces        : None
Installed Size  : 8.20 MiB
Packager        : Levente Polyak <anthraxx@archlinux.org>
Build Date      : Sun May 9 05:53:35 2021
Install Date    : Thu May 13 11:46:42 2021
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : Signature

bash: 250 total files, 0 altered files
Name            : zsh
Version         : 5.8-1
Description     : A very advanced and programmable command interpreter (shell) for UNIX
Architecture    : x86_64
URL             : https://www.zsh.org/
Licenses        : custom
Groups          : None
Provides        : None
Depends On      : pcre  libcap  gdbm
Optional Deps   : None
Required By     : None
Optional For    : fzf
Conflicts With  : None
Replaces        : None
Installed Size  : 6.22 MiB
Packager        : Pierre Schmitz <pierre@archlinux.de>
Build Date      : Sun Feb 16 12:55:21 2020
Install Date    : Thu Feb 20 13:29:14 2020
Install Reason  : Explicitly installed
Install Script  : Yes
Validated By    : Signature

zsh: 1183 total files, 0 altered files
[root@dell-5490-arch valentin]# cat /etc/shells
# Pathnames of valid login shells.
# See shells(5) for details.

/bin/sh
/bin/bash
/bin/zsh
/usr/bin/zsh
/usr/bin/git-shell
[root@dell-5490-arch valentin]# 

Offline

#6 2021-07-21 01:15:01

loqs
Member
Registered: 2014-03-06
Posts: 19,009

Re: [SOLVED] Instant logout after login, consequently to a full upgrade

The single option results in sulogin being used which I believe reads /etc/passwd and /etc/shadow directly without any use of pam.
If you do `su -l test`from the rescue login which will use /etc/pam.d/su-l which which uses a much shorter pam stack does that fail?

Offline

#7 2021-07-21 01:33:38

Vlou
Member
Registered: 2021-07-20
Posts: 5

Re: [SOLVED] Instant logout after login, consequently to a full upgrade

loqs wrote:

The single option results in sulogin being used which I believe reads /etc/passwd and /etc/shadow directly without any use of pam.
If you do `su -l test`from the rescue login which will use /etc/pam.d/su-l which which uses a much shorter pam stack does that fail?

Hi,
It doesn't work, the shell stays root's :

Jul 20 21:30:50 dell-5490-arch su[4194]: (to test) root on tty1
Jul 20 21:30:50 dell-5490-arch su[4194]: pam_unix(su-l:session): session opened for user test(uid=1002) by (uid=0)
Jul 20 21:30:50 dell-5490-arch su[4194]: pam_unix(su-l:session): session closed for user test

But "su test" works well.

Last edited by Vlou (2021-07-21 01:45:42)

Offline

#8 2021-07-21 02:24:56

Vlou
Member
Registered: 2021-07-20
Posts: 5

Re: [SOLVED] Instant logout after login, consequently to a full upgrade

Okay, I finally found the problem !
Thanks to you all for driving me in the right direction.
With this command :

echo exit | strace bash -li |& grep '^open'

I could trace with files are open when there is a user login with a login shell. Here is the result :

openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/libreadline.so.8", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/libncursesw.so.6", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/dev/tty", O_RDWR|O_NONBLOCK) = 3
openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/gconv/gconv-modules.cache", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/gconv/gconv-modules", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/etc/nsswitch.conf", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/libnss_files.so.2", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/etc/passwd", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/dev/tty", O_RDWR|O_NONBLOCK) = 3
openat(AT_FDCWD, "/usr/share/terminfo/x/xterm-256color", O_RDONLY) = 3
openat(AT_FDCWD, "/etc/profile", O_RDONLY) = 3
openat(AT_FDCWD, "/etc/profile.d/", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3
openat(AT_FDCWD, "/etc/profile.d/android-sdk.sh", O_RDONLY) = 3
openat(AT_FDCWD, "/etc/profile.d/flatpak-bindir.sh", O_RDONLY) = 3
openat(AT_FDCWD, "/etc/profile.d/flatpak.sh", O_RDONLY) = 3
openat(AT_FDCWD, "/dev/null", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
openat(AT_FDCWD, "/etc/profile.d/freetype2.sh", O_RDONLY) = 3
openat(AT_FDCWD, "/etc/profile.d/gawk.sh", O_RDONLY) = 3
openat(AT_FDCWD, "/etc/profile.d/gpm.sh", O_RDONLY) = 3
openat(AT_FDCWD, "/etc/profile.d/gradle.sh", O_RDONLY) = 3
openat(AT_FDCWD, "/etc/profile.d/grc.sh", O_RDONLY) = 3
openat(AT_FDCWD, "/root/.bash_logout", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/bash.bash_logout", O_RDONLY) = 3

"/etc/profile.d/grc.sh" is the last file opened before the log out process, so I decided to move this file in another directory.

I tried the same command again, and I got now :

openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/libreadline.so.8", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/libncursesw.so.6", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/dev/tty", O_RDWR|O_NONBLOCK) = 3
openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/gconv/gconv-modules.cache", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/gconv/gconv-modules", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/etc/nsswitch.conf", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/libnss_files.so.2", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/etc/passwd", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/dev/tty", O_RDWR|O_NONBLOCK) = 3
openat(AT_FDCWD, "/usr/share/terminfo/x/xterm-256color", O_RDONLY) = 3
openat(AT_FDCWD, "/etc/profile", O_RDONLY) = 3
openat(AT_FDCWD, "/etc/profile.d/", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3
openat(AT_FDCWD, "/etc/profile.d/android-sdk.sh", O_RDONLY) = 3
openat(AT_FDCWD, "/etc/profile.d/flatpak-bindir.sh", O_RDONLY) = 3
openat(AT_FDCWD, "/etc/profile.d/flatpak.sh", O_RDONLY) = 3
openat(AT_FDCWD, "/dev/null", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
openat(AT_FDCWD, "/etc/profile.d/freetype2.sh", O_RDONLY) = 3
openat(AT_FDCWD, "/etc/profile.d/gawk.sh", O_RDONLY) = 3
openat(AT_FDCWD, "/etc/profile.d/gpm.sh", O_RDONLY) = 3
openat(AT_FDCWD, "/etc/profile.d/gradle.sh", O_RDONLY) = 3
openat(AT_FDCWD, "/etc/profile.d/jre.sh", O_RDONLY) = 3
openat(AT_FDCWD, "/etc/profile.d/libreoffice-fresh.sh", O_RDONLY) = 3
openat(AT_FDCWD, "/etc/profile.d/locale.sh", O_RDONLY) = 3
openat(AT_FDCWD, "/etc/profile.d/maven.sh", O_RDONLY) = 3
openat(AT_FDCWD, "/etc/profile.d/mozilla-common.sh", O_RDONLY) = 3
openat(AT_FDCWD, "/etc/profile.d/PackageKit.sh", O_RDONLY) = 3
openat(AT_FDCWD, "/etc/profile.d/perlbin.sh", O_RDONLY) = 3
openat(AT_FDCWD, "/etc/profile.d/vte.sh", O_RDONLY) = 3
openat(AT_FDCWD, "/etc/profile.d/Z97-byobu.sh", O_RDONLY) = 3
openat(AT_FDCWD, "/etc/bash.bashrc", O_RDONLY) = 3
openat(AT_FDCWD, "/usr/share/bash-completion/bash_completion", O_RDONLY) = 3
openat(AT_FDCWD, "/etc/bash_completion.d/", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3
openat(AT_FDCWD, "/etc/bash_completion.d/pacolog", O_RDONLY) = 3
openat(AT_FDCWD, "/root/.bash_profile", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/root/.bash_login", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/root/.profile", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/root/.bash_history", O_RDONLY) = 3
openat(AT_FDCWD, "/root/.bash_history", O_RDONLY) = 3
openat(AT_FDCWD, "/root/.inputrc", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/inputrc", O_RDONLY) = 3
openat(AT_FDCWD, "/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/share/locale/en_GB.UTF-8/LC_MESSAGES/bash.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en_GB.utf8/LC_MESSAGES/bash.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en_GB/LC_MESSAGES/bash.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en.UTF-8/LC_MESSAGES/bash.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en.utf8/LC_MESSAGES/bash.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en/LC_MESSAGES/bash.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/root/.bash_logout", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/bash.bash_logout", O_RDONLY) = 3
openat(AT_FDCWD, "/root/.bash_history", O_WRONLY|O_APPEND) = 3
openat(AT_FDCWD, "/root/.bash_history", O_RDONLY) = 3
openat(AT_FDCWD, "/root/.bash_history-06605.tmp", O_WRONLY|O_CREAT|O_TRUNC, 0600) = 3

So the git dev version of grc, updated yesterday, and opened whenever a user logs in a login shell is definitely the problem !
Indeed it starts with the following line :

[ x$GRC_ALIASES = xtrue ] || exit 0

which i think explains the instant disconnection.

I installed the official version and now I can login again.
Thank you all again for your help smile
I will now be more careful when using AUR git-devel packages !

Last edited by Vlou (2021-07-21 02:34:34)

Offline

#9 2021-07-21 04:43:49

chintu4
Member
Registered: 2021-07-17
Posts: 2

Re: [SOLVED] Instant logout after login, consequently to a full upgrade

>hello

Offline

#10 2021-07-21 09:25:02

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

Re: [SOLVED] Instant logout after login, consequently to a full upgrade

chintu4 wrote:

>hello

Please don't do that.


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

Board footer

Powered by FluxBB