Solved is will not change shell to bash on the list? 12.1

I keep going
Code:
[root@FreeBSD /usr/home/userx]# chsh -s /usr/local/bin/bash userx
chsh: user information updated

logout login and its still /bin/sh
this is a fresh clean install of FBSD 12.1
 
What happens when you run /usr/local/bin/bash from your /bin/sh prompt?
i just run bash and get bash

Code:
$ su
Password:
[root@FreeBSD /usr/home/userx]# chsh -s /usr/local/bin/bash userx
chsh: user information updated
[root@FreeBSD /usr/home/userx]# exit
exit
$ echo $SHELL
/bin/sh
$ bash

------------------------------------------------------------------
FreeBSD.org
Kernel 12.1-RELEASE
Uptime 12:54PM  up  1:35, 2 users, load averages: 0.90, 0.40, 0.39

HP EliteBook 840 G2
CPU: Intel(R) Core(TM) i5-5300U CPU @ 2.30GHz (2294.74-MHz K8-class CPU)
FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs
------------------------------------------------------------------
userx@FreeBSD.org:/usr/home/userx
$ echo $SHELL
/bin/sh
 
OH I changed my host name , rebooted, and now it works I got bash.. that is a strange one, I never had to reboot to change shell before.
 
From the output above you never logged out and back in again. You just exited the su'd root session.
from that one, I was just giving you the output. and yes I tried logging out and in a few times. that is why i posted. There was no reason to do it just to post back ..
 
I've never seen the need to reboot to. While chsh attempts at changing your shell, if my memory serves me well, the only reason for a failure is if two concurrent sessions are modifying the very same user.
Besides, `SHELL` could have been set at login time, and does not change when you manually change the shell. At least, I don't have a system to try right now, but I remember some issues with testing `SHELL`.
 
Yeah, I do confirm SHELL is the login one:

Code:
luca@miguel ~ % echo $SHELL
/usr/local/bin/zsh
luca@miguel ~ % bash
[luca@miguel ~]$ echo $SHELL
/usr/local/bin/zsh
[luca@miguel ~]$ which bash
/usr/local/bin/bash
[luca@miguel ~]$ chsh -s /usr/local/bin/bash 
Password: 
chsh: user information updated
[luca@miguel ~]$ echo $SHELL
/usr/local/bin/zsh

I suspect, from your example, you did exit the shell without doing a real logout (as others already wrote).
 
well all of the installs before that one, being 12 all I ever had to do was
Code:
chsh -s /usr/local/bin/bash userx
open a different terminal, and this being 12.1 it just didn't is all.
 
Again, I suspect something different went on in your environment, most probably you did have another chsh laying around and overriding or preventing changes:

Code:
% ssh luca@192.168.222.66
luca@test:~ % uname -a
FreeBSD test 12.1-RELEASE FreeBSD 12.1-RELEASE r354233 GENERIC  amd64
luca@test:~ % chsh -s /usr/local/bin/bash
Password: 
chsh: user information updated
luca@test:~ % uptime
 9:00AM  up 4 mins, 2 users, load averages: 0.90, 0.49, 0.22
luca@test:~ % logout
Connection to 192.168.222.66 closed.



% ssh luca@192.168.222.66
[luca@test ~]$ echo $SHELL
/usr/local/bin/bash
[luca@test ~]$ uptime
 9:00AM  up 4 mins, 2 users, load averages: 0.93, 0.52, 0.24
[luca@test ~]$

Note how reboot is not necessary for the shell to change. Are you sure your terminal emulator did not tried to start a shell for you?
 
I have a question and I'm not suggesting I know anything about this.

When you install bash in FreeBSD, doesn't the line /usr/local/bin/bash get appended at the end of /etc/shells? When that line is there, doesn't chsh read from that file to change shells for the user?
 
When you install bash in FreeBSD, doesn't the line /usr/local/bin/bash get appended at the end of /etc/shells? When that line is there, doesn't chsh read from that file to change shells for the user?
The /etc/shells file is simply a list of shells a user is allowed to pick from.
 
I think what he was saying was that you can just do chsh -s bash and it changes the shell even without an absolute path.
 
Back
Top