From owner-freebsd-questions@FreeBSD.ORG Tue Oct 30 11:40:18 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A65ED16A419 for ; Tue, 30 Oct 2007 11:40:18 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id 1CAAD13C4AC for ; Tue, 30 Oct 2007 11:40:17 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from kobe.laptop (vader.bytemobile-rio.ondsl.gr [83.235.57.37]) (authenticated bits=128) by igloo.linux.gr (8.14.1/8.14.1/Debian-9) with ESMTP id l9UBdXgg024132 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 30 Oct 2007 13:39:43 +0200 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.1/8.14.1) with ESMTP id l9UBdCSK053278; Tue, 30 Oct 2007 13:39:28 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by kobe.laptop (8.14.1/8.14.1/Submit) id l9UBdCoc053268; Tue, 30 Oct 2007 13:39:12 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Date: Tue, 30 Oct 2007 13:39:12 +0200 From: Giorgos Keramidas To: Stephen Allen Message-ID: <20071030113912.GB3941@kobe.laptop> References: <472647A0.3030009@brookes.ac.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <472647A0.3030009@brookes.ac.uk> X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-3.99, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.41, BAYES_00 -2.60) X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Spam-Status: No Cc: freebsd-questions@freebsd.org Subject: Re: Dangers of using a non-base shell X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2007 11:40:18 -0000 On 2007-10-29 20:50, 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. > > The quite annoying side-effect is having to type 'exit' twice to get > out of a su shell or screen. > > 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? I've been using the following for some time: keramida> su - Password: ******** root# exec env SHELL=/usr/local/bin/bash bash -l The same trick works with s/bash/mksh/ or s/bash/pdksh/, as far as I can tell, and tcsh's history mechanism makes it easy to run the same command later. All I have to type is "exec " and hit the arrow-up key :) The env(1) trick makes sure that sub-shells use bash(1) too, and 'exec' reduces the number of 'exit' commands I have to type. Now, if there's a problem with bash(1), I will probably have to su again, but that's less trouble than being locked out because gettext has broken, the *default* root shell is bash and _that_ fails all the time. - Giorgos