I've been having an issue with getting my .profile to be sourced when SSHing into an Ubuntu 12.04 server instance. My .bashrc does the following towards the end:
if [[ "$TERM" != "screen-256color" ]] then tmux attach-session -t "$USER" || tmux new-session -s "$USER" exit fi
If I comment out that code block and log in with ssh again, the ~/.profile file is sourced as expected. There is no .bash_profile or .bash_login under ~ which would prevent ~/.profile from being read. Renaming .profile to .bash_profile as an experiment also didn't get the file sourced.
Does anybody have a guess for why that might be happening? I could just stuff everything into .bashrc, but I'd love to find out why .profile isn't being sourced.