On Ubuntu 16.10, I set a system wide environment variable in /etc/environment file. The variable is a string that has a length of thousands of characters (the string is a comma-separated list of small alpha codes). The problem is that the environment variable gets truncated.
Python code to generate the content of /etc/environment file with a variable named X:
fp = open('/etc/environment','w') fp.write('X="' + ",".join([str(i) for i in range(2000)]) + '"') fp.close()
Logout shell, login again and show environment variable
On my machine, result is:
Someone told me about a 128K limit on environment variables but my variable is relatively small in length. Can anyone explain me why it gets truncated and more important, what can I do to remedy to this situation?
EDIT: output of dpkg -l libpam-modules:
Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Architecture Description +++-==============================================-============================-============================-================================================================================================== ii libpam-modules:amd64 1.1.8-3.2ubuntu2 amd64 Pluggable Authentication Modules for PAM