[Novalug] Your SHELL is not in /etc/shells

Peter Larsen peter@peterlarsen.org
Tue Jul 23 02:41:40 EDT 2013


On 07/23/2013 01:27 AM, Jon LaBadie wrote:
> On Mon, Jul 22, 2013 at 09:03:10PM -0400, Peter Larsen wrote:
>> On 07/22/2013 08:02 PM, Jon LaBadie wrote:
>>> Some may not know that recent Fedora releases have
>>> merged /bin and /usr/bin.  The executables are in
>>> /usr/bin and /bin is a symbolic link to /usr/bin.
>> Well, "recent" I guess is relative. I think it was f16 or f17 - sometime
>> around then.
> >From what I read the change was made in F17.  As F19 is less
> than a month old, I'd call that pretty recent.

It was released May 29th 2012 - it's EOL in about one week from now.
That's pretty dated in Fedora eyes. But time is relative as they say :) 
I seem to recall the discussion before the release but that doesn't say
much, since I've probably been playing with both rawhide and some of the
ideas that pop up all the time.
>>> When I saw this I changed my password file entry to
>>> show my shell as /usr/bin/ksh, the actual location.
>>> This field of the password file is used for the
>>> initial value of SHELL upon login.
>> Not sure how you got there?
> Manually :)  I vi'ed the password file.

Well, that does explain things :)

>> Here's my /etc/shells - untouched by me since f14 ...
>> $ cat /etc/shells
>> /bin/sh
>> /bin/bash
>> /sbin/nologin
>> /bin/ksh
>> /bin/zsh
>>
> Identical to mine.

Ok - I thought you were saying you only had one entry in the file and
that it used /usr/bin/... ?  I probably misread it.
>> These entries are already corrected. Try reinstalling the setup rpm and
>> see if things don't reset for you?  These entries match the shell
>> entries in /etc/passwd on my side too. I'm not sure if using the symlink
>> location should work here - maybe someone with more detailed knowledge
>> of the login process will know.
> I don't understand what "correction" you feel was necessary.
> I'm not looking to reset things.  The system has been working
> fine for about 6 months since I modified the password file to
> point to /usr/bin/ksh.  As to whether login will work with the
> symlink, your unmodified system is proof that it does. 

Given the whole of your reply, I think we have a simple
misunderstanding.  I thought you were talking about an upgrade issue
where the location of the shells had changed. I presumed you had
upgraded from a fairly old Fedora version and had run into migration
issues. My mistake - I shouldn't assume stuff like that.

Historically shells were located in /bin - so I like that /etc/shells
still have things where they used to be. The same with passwd.
>>> That edit just bit me when I started  some program
>>> and it refused to run because my SHELL variable was
>>> not listed in /etc/shells.
>> Did you log out and back in first? If you changed the location of your
>> login shell, I would make sure to restart the session to avoid confusion.
>>
> I must have mislead you, my change was made months ago.  I only
> once ran into a problem (easily corrected) when a 3rd party
> package checked if $SHELL was set to a "valid" shell.  I.e. one
> listed in /etc/shells.

Sounds like your 3rd party software has a bug. That said, if you changed
/etc/passwd to say /usr/bin/bash but /etc/shells says /usr/bash I think
that should bring out a warning. Even though they eventually point to
the same location. I think most programs just do a string compare and
they'll get in trouble that way. Given that traditionally /bin was used
for shells, I guess assuming there wouldn't be soft/hard links involved
isn't so far fetched.
>>> I'm a little surprised that Fedora only lists /bin/ksh
>>> and doesn't list both locations in /etc/shells.
>> It shouldn't need to. At least to my knowledge when the migration was
>> done, all shell references where automatically changed to the new location.
> I doubt that.  All shell references were probably left as they
> were, referring to /bin which now points to /usr/bin.

I still don't get why you want both references there. Keep /etc/passwd
consistent with /etc/shells and I don't see a problem?

>
> As /bin/sh and /usr/bin/sh are the same executables I'm surprised
> /etc/shells does not include both.  For example:
>   
>  /bin/sh
>  /usr/bin/sh
>  /bin/bash
>  /usr/bin/bash
>  /sbin/nologin
>  /usr/sbin/nologin
>  ...
>
> My /etc/shells does contain both now.

Understood - but if you kept /usr/bin out of /etc/passwd I don't think
you'll have issues?


-- 
Regards
  Peter Larsen




More information about the Novalug mailing list