An annoyance with $PATH on Red Hat

In the spirit of equal opportunity annoyance:

One of the things that never fails to irritate me with Red Hat is that when you do '/bin/su root' on a stock system, you get a shell whose $PATH doesn't include /sbin or /usr/sbin.

This trips me up all the time, and every time it's an nngh moment. And it's not as if Red Hat doesn't already have a ~root/.bashrc that does quite a lot, so they could perfectly well also have it fix up $PATH to have everything it would if you just logged in as root.

(Yes, yes, 'use sudo'. Frankly, no; if I'm starting up a general root shell, I'm going to be honest about it. And I don't like 'su - root', because that has other effects.)

On my own systems, I've long since customized root's .bashrc so that when I su, it switches to my preferred shell; other bits then insure that I get a sensible root environment (including sanitizing $PATH). This may be evil, but it is convenient.

(There's an argument that Red Hat's default root .bashrc is already evil since it aliases cp, mv, and rm to their -i forms, but I'm not going to go there. Especially since I do it myself.)

Sidebar: a pop usage conundrum

In the above, is the right usage 'a nngh moment' or 'an nngh moment'?

These are my WanderingThoughts
(About the blog)

GettingAround
Full index of entries
Recent comments

This is part of CSpace, and is written by ChrisSiebenmann.

* * *

Atom feeds are available; see the bottom of most pages.

This is a DWiki.
(Help)

Categories: links, linux, programming, python, snark, solaris, spam, sysadmin, tech, unix, web

Search:
Written on 21 February 2006.
(Previous | Next)

Page tools: View Source, Add Comment.
Search:
Login: Password:
Atom Syndication: Recent Comments.

Last modified: Tue Feb 21 03:13:09 2006
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.