Log in loop following environment change

You assumed that /etc/environment is a script file which expands variables. It's not.