Date: Tue, 11 Nov 2008 08:49:55 +0100 From: Mel <fbsd.questions@rachie.is-a-geek.net> To: freebsd-questions@freebsd.org Cc: Daniel Howard <dannyman@toldme.com>, Pieter Donche <Pieter.Donche@ua.ac.be> Subject: Re: root /etc/csh Message-ID: <200811110849.56028.fbsd.questions@rachie.is-a-geek.net> In-Reply-To: <2a5241e00811101519k505dcaabvd59fecc19d283bc3@mail.gmail.com> References: <20081110110805.GK1302@obspm.fr> <Pine.GSO.4.63.0811102239200.846@hmacs.cmi.ua.ac.be> <2a5241e00811101519k505dcaabvd59fecc19d283bc3@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday 11 November 2008 00:19:32 Daniel Howard wrote:
> On Mon, Nov 10, 2008 at 1:46 PM, Pieter Donche <Pieter.Donche@ua.ac.be>
wrote:
> > FreeBSD 7.0 comes with the user root with start up shell /bin/csh
> > As normal user I use bash (/usr/local/bin/bash installed)
> > I would prefer to have bash also when working as root (su).
> > Of course I can do
> > # bash
> > [root ~]# or I could change the startup shell in /etc/passwd, but would
> > that be a wise
> > thing to do or not?
>
> If your system is having a bad time, falling back to statically-linked
> /bin/csh
/bin/csh is not statically linked. /rescue/csh is.
> can help you out in a jam, whereas pointing way off to
> /usr/local/bin/bash could spell trouble if say, you can not mount
> /usr.
More likely trouble scenario is gettext library version bump. However, bash
can be statically compiled by the port and you can also set $PREFIX to /, so
it gets installed as /bin/bash.
That said, you should before you change root's shell have dealt with a broken
root shell a few times, to be able to ascertain whether this extra problem is
something you want to deal with, at the times you already have a more
pressing problem to solve.
>
> As prad pointed out, you can "su -m". I myself prefer "sudo -s".
Unfortunately, sudo -i is not a substitute for su -l, as sudo tries to be more
secure then it should be, cleaning the environment, preserving PATH, rather
then taking the correct values from /etc/login.conf. Most notably tilde and
dollar sign expansion, which are great *shell-independant* features:
$ grep setenv /etc/login.conf
:setenv=MAIL=/var/mail/$,BLOCKSIZE=M,FTP_PASSIVE_MODE=YES,PACKAGES=/var/pkg/7-stable,PKG_PATH=/var/pkg/7-stable\c.
\c/home/$/packages,CCACHE_DIR=/var/db/ccache/$:\
$ echo {$CCACHE_DIR:=No}
/var/db/ccache/mel
$ echo $MAIL
/var/mail/mel
$ sudo -c root -i
# echo ${CCACHE_DIR:=No}
No
# echo $MAIL
/var/mail/mel
--
Mel
Problem with today's modular software: they start with the modules
and never get to the software part.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200811110849.56028.fbsd.questions>
