On most of our servers, tab completion of service names after typing in the service command no longer works, as root. It works just fine as non-root. This is on Ubuntu 12.04. I'm not sure how to approach troubleshooting this.
Demonstrating:
Tab completion works as the normal user zachary
, who pressed tab to list completions in the first image:
But as user root
, it doesn't list services as completions (only files):
Any help would be greatly appreciated.
Best Answer
This is disabled by default on Ubuntu.
Read your
/root/.bashrc
:Bash completion is all commented out. Apparently there's a reason for it I'm not aware of (recovery single user mode perhaps?).
The reason for why it does work when you do
sudo su
,sudo -s
,sudo bash
is that it doesn't really runlogin
to make you completely root. When runningsudo su -
orsudo -i
it really does completely logs you in as that user. Here, by example of the environment variable$HOME
, more of this difference: