Why is neither /root/.bashrc nor /root/.profile executed after sudo -i?

I have export PATH="$PATH:/opt/local/bin" in /root/.bashrc and /root/.profile (nothing else in /root/.profile) and /bin/bash is the login shell for root in /etc/passwd. Yet invoking sudo -i (which according to man sudo starts a login shell and should run ~/.profile) causes /opt/local/bin to be absent from PATH according to echo $PATH.

EDIT: invoking bash explicitly causes /root/.bashrc to be sourced.

The output of sudo grep 'export PATH=' /root/.bashrc is

export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
export PATH="$PATH:/opt/local/bin" # MacPorts

/etc/sudoers (99 % sure I didn't change anything):

Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
root ALL=(ALL:ALL) ALL
%admin ALL=(ALL) ALL
%sudo ALL=(ALL:ALL) ALL
11 Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like