Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Login fails (loop) #16

Closed
schwabfk opened this issue Nov 10, 2022 · 9 comments
Closed

Login fails (loop) #16

schwabfk opened this issue Nov 10, 2022 · 9 comments
Assignees

Comments

@schwabfk
Copy link

Hello,

I wanted to test your script and installed it as suggested by inserting the respective line in the bashrc file, but this causes a login failure (opensuse tumbleweed, kde plasma, sddm). More specifically, at the login screen I enter my username and password (which both are correct), it seems to load the kde desktop but then jumps back to the login screen. Removing the script from the bashrc allows to login correctly again.

Do you have any ideas how to make your script your in such cases, because I really like its style!

@agkozak agkozak self-assigned this Nov 10, 2022
@agkozak
Copy link
Owner

agkozak commented Nov 10, 2022

I haven't seen that problem before! Please start out by posting your .bashrc. Thanks.

@edklem
Copy link
Contributor

edklem commented Nov 10, 2022

agkozak, I have seen something like this before with gnome/gdm. I didn't think it was polyglot issue so I solved it using this in my .bashrc:

if tty -s
then 
    . /path/to/polyglot.sh
fi

That seemed to be all that was needed.
I believe the issue is that the DE loads profiles like .bashrc on login - so the if tty -s just checks if you are loading .bashrc from a terminal/console (which the DE would not be) and then loads polyglot.sh. Something similar could be added at the beginning of the code to check if it's a console and exit if not...

@schwabfk
Copy link
Author

agkozak, I have seen something like this before with gnome/gdm. I didn't think it was polyglot issue so I solved it using this in my .bashrc:

if tty -s
then 
    . /path/to/polyglot.sh
fi

That seemed to be all that was needed. I believe the issue is that the DE loads profiles like .bashrc on login - so the if tty -s just checks if you are loading .bashrc from a terminal/console (which the DE would not be) and then loads polyglot.sh. Something similar could be added at the beginning of the code to check if it's a console and exit if not...

That's it!
I just added the lines as you suggested them, and now there is no problem anymore, thanks a lot.

@agkozak Perhaps you can add it as a "troubleshoot" to the readme.md?

@agkozak
Copy link
Owner

agkozak commented Nov 10, 2022

@edklem, thanks for providing @schwabfk with a quick fix.

@schwabfk, what's in your .bash_profile, .profile, and .bash_login files? Is there any possibility that one of them is sourcing .bashrc?

@schwabfk
Copy link
Author

schwabfk commented Nov 10, 2022

@edklem, thanks for providing @schwabfk with a quick fix.

@schwabfk, what's in your .bash_profile, .profile, and .bash_login files? Is there any possibility that one of them is sourcing .bashrc?

Sure, but as it is a complete new installation, they are pretty empty, but here you go:
[only .profile and .bashrc, as .bash_profile and .bash_login do not exist in opensuse (as far as I know)]

.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

# Some applications read the EDITOR variable to determine your favourite text
# editor. So uncomment the line below and enter the editor of your choice :-)
#export EDITOR=/usr/bin/vim
#export EDITOR=/usr/bin/mcedit

# For some news readers it makes sense to specify the NEWSSERVER variable here
#export NEWSSERVER=your.news.server

# 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

    # Sample .bashrc for SUSE Linux
    # Copyright (c) SUSE Software Solutions Germany GmbH
    
    # 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
    # settings made here will also take effect in a login shell.
    #
    # NOTE: It is recommended to make language settings in ~/.profile rather than
    # here, since multilingual X sessions would not work properly if LANG is over-
    # ridden in every subshell.
    
    test -s ~/.alias && . ~/.alias || true
    
    # polyglot bash colours
    if tty -s
    then 
      . /home/schwabfk/bash-polyglot/polyglot
    fi

@agkozak
Copy link
Owner

agkozak commented Nov 10, 2022

. home/schwabfk/bash-polyglot/polyglot

Should it be . home/schwabfk/bash-polyglot/polyglot.sh, or perhaps you renamed the script?

@schwabfk
Copy link
Author

. home/schwabfk/bash-polyglot/polyglot

Should it be . home/schwabfk/bash-polyglot/polyglot.sh, or perhaps you renamed the script?

It's just renamed ;)

@agkozak
Copy link
Owner

agkozak commented Nov 10, 2022

It's just renamed ;)

Got it, thanks. OK, I'll have time to think about this a little later, and perhaps you can help me to troubleshoot more.

agkozak added a commit that referenced this issue Nov 16, 2022
@agkozak
Copy link
Owner

agkozak commented Nov 16, 2022

@edklem and @schwabfk - I want to thank both of you for reporting this bug. It was a case of typing exit when I meant return! Sorry for any inconvenience.

@agkozak agkozak closed this as completed Nov 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants