Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Want to replace bash w zsh as system shell on Ubuntu
- X-seq: zsh-users 14798
- From: Phil Pennock <zsh-workers+phil.pennock@xxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: Want to replace bash w zsh as system shell on Ubuntu
- Date: Fri, 5 Feb 2010 14:42:55 +0100
- Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=spodhuis.org; s=d200912; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:To:From:Date; bh=a0aIc9SpJnt9W6RawEdnsChwUN82nA79Ym9cPVazKwQ=; b=ZEZsHl3hH0Ti9XNvRzd+o+RmpLoMOgrBXdkAzyMtw4n9b30tuc82LFbW1q33rW52E6QnLiy8A0gRHs437MYXcD1VDFw1VmwaSQ9fulCtlJNs/6dXcxoC4Jt4cHFSJv2rjqjCrwnV3wuboWAjzJOMWkQ9b9cEzrBJ6ShEVBMZf7M=;
- In-reply-to: <20100204062334.GA19141@xxxxxxxxx>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mail-followup-to: zsh-users@xxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <20100202081546.GA5930@xxxxxxxxx> <87vdefkeuf.fsf@xxxxxxxxxxxxxxxxxxxxxx> <20100204062334.GA19141@xxxxxxxxx>
On 2010-02-04 at 01:23 -0500, rj wrote:
> Sorry to sound all the alarms about /bin/sh (but glad to have spawned
> a discussion). I'd never muck with /bin/sh -- 95% of all scripts reference
> it in their first line.
>
> On Tue 02/02/10 at 01:21 PM +0100, Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx> wrote:
>
> > If this whole question is about the interactive shell that you're
> > getting dropped into by `sudo' (which I suspect), I'd change root's
> > shell to zsh by chsh(1) and use `sudo -i' instead of `sudo -s'.
>
> This is what I did, and am doing.
As a contrasting point of view:
I don't change root's shell. I don't put much in root's start-up. When
I'm logging in as root, I want to be in as cleanly and simply as
possible, because I don't know what sort of state the system will be in
then. Perhaps something's running amok and forking a new process will
add a four minute delay, for instance. (Ah yes, triggerable memory
leaks, such fun).
The *safest* way is to leave root's shell as /bin/sh but to edit
/root/.profile (or whatever to include the line:
alias z='exec zsh -l'
That's so simple that when I'm working interactively I can type z<enter>
without even thinking about it.
This is also a good habit to get into when working on systems where
multiple people have root. There's no need to have arguments about
shells, etc. Especially if you code up some logic which looks at where
you're connecting from and uses a dispatch table to let different people
have different shell configurations as root. (Managing
deploying/maintaining those is another matter).
So in my case, there's one scenario in which I try to fork two extra
commands in root login, on console, on the basis that if fork fails,
it's not a disaster and I'm more likely to be dealing with a runaway
memory hog and anything that gets me more CPU when coming in on serial
console is likely to be a net win:
----------------------------8< cut here >8------------------------------
alias z='exec zsh -l'
alias b='exec bash --login'
if [ $TERM = vt100 ]; then
if [ `tty` = /dev/ttyd0 ]; then
renice -5 $$
echo "Did: renice -5 $$"
fi
fi
alias n='renice -5 $$'
----------------------------8< cut here >8------------------------------
Just a thought,
-Phil
Messages sorted by:
Reverse Date,
Date,
Thread,
Author