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

[BUG] using lchsh to change the shell brings user back to fedora setup #307

Closed
axtloss opened this issue Jul 3, 2022 · 6 comments
Closed
Labels
bug Something isn't working docs Related to the docs or needing docs f36 Related to Fedora 36 need-info Further information is requested

Comments

@axtloss
Copy link

axtloss commented Jul 3, 2022

This issue tracker is intended only for Silverblue specific issues. We would like to ask you to try to reproduce the issue on a relevant Fedora Workstation release. If you will be able to reproduce there, then please report it in Red Hat Bugzilla or in upstream (preferred for GNOME projects) and not in this issue tracker.

Describe the bug
When using lchsh to change the default shell (in this case to fish), the user gets brought back to the first-boot/fedora setup screen, where they are prompted to create a new user.

To Reproduce
Please describe the steps needed to reproduce the bug:

  1. run sudo lchsh <username>
  2. follow the lchsh instructions and properly change the shell
  3. reboot silverblue
  4. get brought to the setup screen

Expected behavior
The shell should change and the user should be able to log into their user normally, without having to go through the setup again.

Screenshots

OS version:

State: idle
AutomaticUpdates: stage; rpm-ostreed-automatic.timer: inactive
BootedDeployment:
● fedora:fedora/36/x86_64/silverblue
                   Version: 36.20220702.0 (2022-07-02T01:29:19Z)
                BaseCommit: 3afc1bafc3fbada0e16fe7579d4612f732d9f71c3bafe928e49f2699bdd77c65
              GPGSignature: Valid signature by 53DED2CB922D8B8D9E63FD18999F7CBF38AB71F4
       RemovedBasePackages: firefox 102.0-1.fc36
           LayeredPackages: akmod-nvidia binutils fish kitty langpacks-en libinput-utils wmctrl xorg-x11-drv-nvidia-cuda
             LocalPackages: rpmfusion-free-release-36-1.noarch rpmfusion-nonfree-release-36-1.noarch

AvailableUpdate:
        Version: 36.20220703.0 (2022-07-03T00:41:13Z)
         Commit: 48cc35cbf01e890bbaa1fe0589a8115781d2595b842f2632dc61db27572ef855
   GPGSignature: Valid signature by 53DED2CB922D8B8D9E63FD18999F7CBF38AB71F4
           Diff: 9 upgraded

Additional context
The original user still exists, and once the user goes through the setup and creates a new user they can still log into the old user, the shell is also succesfully changed.

@travier travier added the bug Something isn't working label Jul 3, 2022
@travier
Copy link
Member

travier commented Jul 3, 2022

I don't now what the root cause of this specific bug is but in general, my recommendation is to not change the login shell of users in Silverblue. You never know when you will need to reset the overrides and once you do that, you won't be able to login as the shell will not exists anymore.

Instead, you can add something to your bashrc that checks if the shell that you want is installed and then execute it by default.

@travier travier added need-info Further information is requested f36 Related to Fedora 36 labels Aug 19, 2022
@CheariX
Copy link

CheariX commented Aug 20, 2022

Instead, you can add something to your bashrc that checks if the shell that you want is installed and then execute it by default.

I added the following to my .bashrc:

if [ -f /usr/bin/fish ]; then
    exec /usr/bin/fish
fi

Also it works as long as you are logged in, I could no longer login using GDM after a restart.
So, I cannot recommend this code snippet (maybe there must be some additional checks).

@travier
Copy link
Member

travier commented Aug 20, 2022

You probably want something like below (untested):

if [[ $- == *i* ]] && [[ -f /usr/bin/fish ]]; then
    exec /usr/bin/fish "$@"
fi

from https://unix.stackexchange.com/questions/26676/how-to-check-if-a-shell-is-login-interactive-batch

@signalblur
Copy link

signalblur commented Aug 28, 2022

Hello - this actually happened to me as well. Verify that your new shell actually installed properly (try and enter it from the new user). When I had this happen, it was because for whatever reason when I ran rpm-ostree install zsh it didn't actually apply it until I did a grub2-mkconfig and it wasn't seeing the binary. If you do a:

sudo nano /etc/passwd

And change the shell back to /bin/bash and sign out and on your regular user do a sudo userdel $NEW_USER_HERE to get rid of any temp users you may have created from this.

Hope this helps!

EDIT: modifying the shell in /etc/passwd to /bin/zsh after installing zsh is how I personally change my shell in silverblue as it is a bit simpler then adding the syntax to your shell config.

This should also work regardless of shell 😄

@travier
Copy link
Member

travier commented May 15, 2023

From my perspective, this is not an issue in Silverblue. We should deprecate allowing changing the users shell entirely but that's a much larger change. See #307 (comment) for more details.

Fedora 36 is about to go EOL so I'll close this issue. Please provide updated information if this is still an issue.

@travier travier closed this as not planned Won't fix, can't repro, duplicate, stale May 15, 2023
@travier travier added the docs Related to the docs or needing docs label May 15, 2023
@travier
Copy link
Member

travier commented May 15, 2023

We welcome docs PRs to document this issue in the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working docs Related to the docs or needing docs f36 Related to Fedora 36 need-info Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants