When I login to root via
sudo changes the working directory of new shell to root's home directory. I can use following commands to keep working directory of parent shell:
sudo -s sudo su ...
but none of these invoke login shell, which means that files like
/etc/profile.d/foobar.sh are NOT sourced.
How can you you invoke login shell via sudo and stay at the same directory?
I can use
sudo zsh -l
The downside is that I'm hard-coding the shell, but that's no big deal, since it probably won't change in my lifetime. :-)