> I just (for the first time ever) installed FreeBSD (3.4-stable).
> That went pretty well, I even got multibooting with NT working.
> Then I wanted to install a new shell ( I think default was csh ). I decided
> to go with bash, so I got a tar-ball with the source and compiled it. That
> went ok, but then I had to install the shell...
The easy way to do it is go to /usr/ports/shells/bash (I think you have
a choice of two versions of bash) and (as root) type
make install
That gets the source, builds it, installs it, and adds it to /etc/shells.
All you need, then, is an initialization file (.bashrc or whatever) in
your home directory. Installed binaries usually (except for X bins) go
in /usr/local/bin.
Quote:> I added the shell to
> /etc/shells
> and ran chsh and changed the variable shell to /usr/bash/bash-2.03/bash
> where I though bash was - thats where I compiled it.
> "Fine" I thought, and rebooted....
The location of bash, where you put it, is not in the path of binaries
searched. It's totally non-standard for FreeBSD.
If you do it by hand (rather than using the ports mechanism) you need to
get the same, correct path in master.passwd, which you can do with chsh,
and in /etc/shells.
Quote:> But when I try and login it says that it cannot find
> /usr/bash/bash-2.03/bash
> and goes back to the login-prompt.
You should be able to log in as root and edit what you need to edit.
If you can't log in as root, you can boot (with boot -s as the boot
process begins), or possibly boot /kernel -s, or boot -s /kernel
(sorry I don't remember exactly what it is for that version) into
single-user mode.
Then do mount -u / to mount the root partition read-write, mount -a
to mount everything else and get access to ee or vi or pico or whatever
you use as an editor.
Quote:> So in effect I cannot login now !
> Anyway, there are a couple of answers I need..
> a) I there a smart way of fixing this
As root mv /usr/bash/bash-2.03/bash /usr/local/bin, hash or rehash to
get binaries in path reread, put /usr/local/bin/bash in /etc/shells,
use vipw (yes, do it!) to edit master.passwd and have the data base
rewritten, and put your shell in there as /usr/local/bin/bash.
Quote:> b) if no, then what is the name of the file that chsh edits? That is, which
> config-files tells what the default shell is - I wanna change this back to
> /bin/chsh for now
To /bin/csh, you mean. You really have to be careful with this stuff or
it doesn't work. :) But don't go back; csh is a poor shell for command
line work and worse for scripts. bash is good for both.
Do not replace csh or sh in /bin with bash. bash is not statically
linked and won't run in single user mode, so you need those shells there.
Quote:> c) I tried to boot with the fixit-floppy which lets me boot into the system,
> where I can change files, but when I tried to run chsh I says that a
> "shared-resource" is missing. How do I share a resource?
> It was called lib???.so.2 or something.
again, just type vipw It will let you edit the password file directly,
which is the file chsh edits.
And set up another user able to su to root so that if you get in this
situation again, you have an easier way out. This would work remotely
as well, since you can't by default telnet into a system and log in as
root (major security problem there). The adduser program lets you set
some defaults, but you can give a user any valid shell.
Quote:> Thank you
> - Karl Krukow
Annelise