suddenly can't get beyond plasma login

I rebooted my laptop and my user can’t login under any session type (password/username are valid and accepted). Root can log in fine - spinner shows and then KDE appears. User has password accepted, but the little spinning comet never appears and am dumped back to login screen. Tried checking all partitions with 2017 gparted (booted from a USB drive). Trying to get to a console to to a user login to see if errors are listed.

Does this sound at all familiar?

Thank You!

[edit]
OK - I think I got it - something “unfindable” in my .bashrc - trying to source a missing file in an if … fi bash statement.
That seems a tad buggy. Plasma should just throw an error and log me in anyway.
(I need to stop using 4 letter words when I’m completely flummoxed… haha!)

Haha - “Thou shalt know vi.” …and have 2 or more computers connected to the internet…

Disagree (maybe):

  • “~/.bashrc” should only be called when a ‘bash’ terminal session is started.
  • “~/.profile” should be called whenever a user’s session is started (regardless of how that user’s session is being started).

Do you have something in “~/.profile” which is calling “~/.bashrc” regardless of whether a terminal session is being started or not?

This has been default /etc/profile behavior on *SUSE for as long as I remember.

Hi arvidjaar anddcurtisfra

All I know is this fixed it. I logged in as root, ctrl-alt-F3’d into a tty (thank you linux classes on youtube), and vi’d the user’s .bashrc, commented out the offending “if … fi” statement (which just called a profile file I had removed), and now user can login just fine.

User couldn’t log in even at a tty because system would say it couldn’t find that profile file, and then it would dump user back at the “logon:” statement.

Thank You!!! It’s wonderful having this community!!!

Oops, I didn’t understand at first… I don’t think I’ve ever edited ~/.profile. I’ll look…
No, there’s only a “test … PROFILEREAD …” statement in there (default).

So I guess when you login to KDE, it runs .bashrc. Hmmm…

I guess it makes sense to read ~/.bashrc when KDE spins-up because source, PATH, etc. statements are in there for software you may have installed that is callable by KDE mouseclicks - but it seems like preventing a login is not very linux-newbie friendly (hence the comment about “semi-buggy behavior”). :slight_smile:

Also, for at least one of the login splash screens, there’s no explicit option to do a console login - although if you know about ctrl+alt+F* tty access, that’s not really necessary? Still, what about newbies? Maybe that and basic vi editing should be on the driver’s license exam? rotfl!

Hi
It reads /etc/profile and /etc/profile.d/ for system wide and initial user setup…

It’s always a good idea to use tests for a files presence eg;


test -r somefile || { echo "somefile doesn't exist";
    if  "$1" = "stop" ]; then exit 0;
    else exit 6; fi; }

Have a read here https://www.tldp.org/LDP/abs/html/fto.html

Disagree:

  • ‘~/.profile’ is read whenever a login shell is started and, most (but not all) graphic sessions such as X11 will also read ‘~/.profile’.
  • Interactive Bash shells also call ‘~/.bashrc’

Therefore, things such as PATH statements and language settings should (for the moment) be defined in ‘~/.profile’.

Please take a look at the default openSUSE environment for a newly created user – it’s located in “/etc/skel/”.


 > ls -al /etc/skel/
total 64
drwxr-xr-x   7 root root  4096 Nov 22 16:57 .
drwxr-xr-x 137 root root 12288 Jan  5 17:57 ..
-rw-------   1 root root     0 May 18  1996 .bash_history
-rw-r--r--   1 root root  1177 Jul  7 17:10 .bashrc
drwx------   2 root root  4096 May 10  2017 .config
-rw-r--r--   1 root root  1637 Sep 11  2014 .emacs
drwxr-xr-x   2 root root  4096 May 10  2017 .fonts
-rw-r--r--   1 root root   305 May 10  2017 .i18n
-rw-r--r--   1 root root   861 Sep 11  2014 .inputrc
drwx------   2 root root  4096 May 10  2017 .local
-rw-r--r--   1 root root  1028 Jul  7 17:10 .profile
-rw-r--r--   1 root root  1952 May 10  2017 .xim.template
-rwxr-xr-x   1 root root  1112 May 10  2017 .xinitrc.template
drwxr-xr-x   2 root root  4096 May 10  2017 bin
drwxr-xr-x   2 root root  4096 Nov 22 16:53 public_html
 > 

When Wayland replaces X11, the per user environment definitions may have to be moved to a different (systemd) place.

Hi Malcom - I guess I’m missing something here… if I uncomment the if … fi lines in ~/.bashrc which refer to EMS.profile, then user can’t login either in a desktop or console. I have removed that EMS.profile and the system complains it doesn’t exist as the cause of non-login.

~./profile

# Sample .profile for SuSE Linux
# rewritten by Christian Steinruecken <cstein@suse.de>
#
# This file is read each time a login shell is started.
# All other interactive shells will only read .bashrc; this is particularly
# important for language settings, see below.

test -z "$PROFILEREAD" && . /etc/profile || true

# Most applications support several languages for their output.
# To make use of this feature, simply uncomment one of the lines below or
# add your own one (see /usr/share/locale/locale.alias for more codes)
# This overwrites the system default set in /etc/sysconfig/language
# in the variable RC_LANG.
#
#export LANG=de_DE.UTF-8    # uncomment this line for German output
#export LANG=fr_FR.UTF-8    # uncomment this line for French output
#export LANG=es_ES.UTF-8    # uncomment this line for Spanish output


# Some people don't like fortune. If you uncomment the following lines,
# you will have a fortune each time you log in ;-)

#if  -x /usr/bin/fortune ] ; then
#    echo
#    /usr/bin/fortune
#    echo
#fi

~/.bashrc (most default comments deleted; also, the offending if … fi lines are commented out - but you can see what they were doing)

# Sample .bashrc for SuSE Linux
# Copyright (c) SuSE GmbH Nuernberg

# There are 3 different types of shells in bash: the login shell, normal shell
# and interactive shell. Login shells read ~/.profile and interactive shells
# read ~/.bashrc; in our setup, /etc/profile sources ~/.bashrc - thus all
test -s ~/.alias && . ~/.alias || true

#if  -f /OSS/Data/users/00_GCMs/00_UEMS/uems/etc/EMS.profile ] ; then
#   . /OSS/Data/users/00_GCMs/00_UEMS/uems/etc/EMS.profile
#fi

#echo "Setting up INTEL FORTRAN..."
#source /opt/intel/bin/compilervars.sh intel64
#echo "Done setting up INTEL FORTRAN!"

unset LD_LIBRARY_PATH
source /home/patti/vapor-2.6.0/bin/vapor-setup.sh
cal

The issue is being caused by the extraneous “;” in the “if-then-fi” compound command.

Use either:


if  *Test for something* ]
then
  *Do something*
fi

or

if  *Test for something* ]; then *Do something*; fi

This is absolutely correct syntax. Actually “;” must be there as long as “then” follows on the same line.

Ooops!! My mistake:


 > bash -vx PlasmaLogin_bashrc        
# Sample .bashrc for SuSE Linux
# Copyright (c) SuSE GmbH Nuernberg

if  -f /OSS/Data/users/00_GCMs/00_UEMS/uems/etc/EMS.profile ] ; then
   . /OSS/Data/users/00_GCMs/00_UEMS/uems/etc/EMS.profile
fi
+ '' -f /OSS/Data/users/00_GCMs/00_UEMS/uems/etc/EMS.profile ']'

test -s ~/.alias && . ~/.alias || true
+ test -s /home/XXX/.alias
+ true
 > 

But, forcing the execution of the non-existent file only raises a “file-not-found” error:


 > bash -vx PlasmaLogin_bashrc-002
# Sample .bashrc for SuSE Linux
# Copyright (c) SuSE GmbH Nuernberg

if  -f /OSS/Data/users/00_GCMs/00_UEMS/uems/etc/EMS.profile ] ; then
   . /OSS/Data/users/00_GCMs/00_UEMS/uems/etc/EMS.profile ; else
   echo "Do it anyway" ; . /OSS/Data/users/00_GCMs/00_UEMS/uems/etc/EMS.profile
fi
+ '' -f /OSS/Data/users/00_GCMs/00_UEMS/uems/etc/EMS.profile ']'
+ echo 'Do it anyway'
Do it anyway
+ . /OSS/Data/users/00_GCMs/00_UEMS/uems/etc/EMS.profile
PlasmaLogin_bashrc-002: line 6: /OSS/Data/users/00_GCMs/00_UEMS/uems/etc/EMS.profile: No such file or directory

test -s ~/.alias && . ~/.alias || true
+ test -s /home/XXX/.alias
+ true
 > 

The original question: “Why is a KDE login session calling $HOME/.bashrc ?” is still not answered.

  • Inspecting ‘/etc/profile’ only reveals that, if the login is via SSH then, ‘/etc/profile’ will call ‘$HOME/.bashrc’ .

[HR][/HR]Or, could it be that, the EMS profile exists but, isn’t readable for the user logging in?

  • If this is true then, the correct Bash test should be ‘-r’ in place of ‘-f’.