Red Hat Bugzilla – Bug 143824
root path after su should have sbin directories
Last modified: 2014-03-16 22:51:31 EDT
After freshly installing Fedora Core 3, I logged in as beland and su'd
to root and typed "service network restart". This failed because
"service" was not in my path.
When both root and beland use /bin/bash as shells, I get the following
Path when I log in as beland:
Path when I su to root from beland:
Path when I log in as root:
Using /bin/tcsh, the only difference is when I log in as root:
The upshot of this bug is that /usr/local/sbin, /sbin, and /usr/sbin
should appear in root's path after an su, and they don't (for both
bash and tcsh).
I'm not sure why /root/bin should be in there at all, considering that
it doesn't exist after a fresh install.
Use 'su -' to start a login shell as root.
*** Bug 187359 has been marked as a duplicate of this bug. ***
"su -" changes the current working directory to /root, which is somewhat
inconvenient when you're in the middle of something, so I don't do that. Around
the office, everyone I've seen change to root uses "su" instead of "su -", and
has hit the /sbin problem when I tell them how to stop and start services.
Apparently the person who reported 187359 has also tripped over this problem.
Is there anything else that "su -" does that makes a difference? It seems like
an easy fix to patch the path, to make the interface a little more user-friendly.
Fedora Core 3 is now maintained by the Fedora Legacy project for security
updates only. If this problem is a security issue, please reopen and
reassign to the Fedora Legacy product. If it is not a security issue and
hasn't been resolved in the current FC5 updates or in the FC6 test
release, reopen and change the version to match.
This is still an issue in Fedora 8.
this will be fixed in Fedora 10. It's not fixed in Fedora 10 Alpha, but perhaps it will be in the beta release.
*** This bug has been marked as a duplicate of bug 458176 ***