Dangers of using a non-base shell

Erik Osterholm freebsd-lists-erik at erikosterholm.org
Tue Oct 30 08:12:37 PDT 2007


On Mon, Oct 29, 2007 at 08:50:40PM +0000, Stephen Allen wrote:
> It's been drawn to my attention not to use bash from the ports 
> collection, because if one of it's dependencies (gettext or libiconv) 
> fails or is updated significantly, it could break, and prevent login. 
> The suggested solution was to use a base shell (such as sh) and append 
> 'bash -l' to .shrc to automatically enter bash.

I've only ever heard this advice applied to the root account.
Generally speaking, I keep my root accounts using /bin/csh and I run
(z|k)sh on my user accounts.  If something were ever to break, I'd
just log in as root to fix it.

 
> The quite annoying side-effect is having to type 'exit' twice to get out 
> of a su shell or screen.

For screen, you can just change the SHELL environment variable before
you run it:
SHELL=/usr/local/bin/pdksh screen
New screen windows will use the new shell.  For a more permanent fix,
you can add e.g. "shell /usr/local/bin/pdksh" to your .screenrc file.


> Would it be a better idea to use the pre-compiled binary for bash?  And 
> if I did so, could I be alerted to updates as easy as using 'pkg_version 
> -v' when checking if any ports need updating?

There was a pretty long thread on this here: 
http://lists.freebsd.org/pipermail/freebsd-questions/2007-October/159670.html

Another issue that you'll have to contend with is that if your
filesystem on which bash lives fails to mount, you'll be in the same
boat.  You could copy it to /bin (which is usually on the same
filesystem as / and /boot, meaning you're almost guaranteed to have
it, even if other filesystems fail to mount) but I don't like
cluttering up my filesystem.


> Many thanks,
> Steve

Erik


More information about the freebsd-questions mailing list