How does one set the PATH for non-login shells in CentOS 7?
Specifically, I have a systemd unit that needs binaries in /usr/local/texlive/2016/bin/x86_64-linux.
I attempted to set it in /etc/environment with PATH=/usr/local/texlive/2016/bin/x86_64-linux:$PATH but then my PATH was /usr/local/texlive/2016/bin/x86_64-linux:$PATH:/usr/local/sbin:/usr/sbin.
I created /etc/profile.d/texlive.sh with export PATH="/usr/local/texlive/2016/bin/x86_64-linux:${PATH}" but that only worked for login shells.
I looked at Set Path for all Users (Login and Non-login Shells) but the solution was already attempted above.
I looked at How to add a path to system $PATH for all users's non-login shell and login shell on debian but there's no accepted solution and I'm not sure I want to modify /etc/login.defs because it might get changed in an update.
--loginbefore the-cto force this instead of settting the PATH, but you will be making bash run lots of setup that might not work well in the bare systemd environment, and give you errors in the journal log. – meuh Feb 27 '17 at 15:51