I have an issue where a tomcat process started through salt stack is getting different environment variables than the ones set on the system. This is on a centos 7 server.
Below is the locale -v settings i get when i run the command on the server and then when i run the command through salt (salt executes the command as root)
locally run:
LANG=en_GB.UTF-8
LC_CTYPE=en_GB.UTF-8
LC_NUMERIC=en_GB.UTF-8
LC_TIME=en_GB.UTF-8
LC_COLLATE=en_GB.UTF-8
LC_MONETARY=en_GB.UTF-8
LC_MESSAGES=en_GB.UTF-8
LC_PAPER=en_GB.UTF-8
LC_NAME=en_GB.UTF-8
LC_ADDRESS=en_GB.UTF-8
LC_TELEPHONE=en_GB.UTF-8
LC_MEASUREMENT=en_GB.UTF-8
LC_IDENTIFICATION=en_GB.UTF-8
LC_ALL=
with salt:
LANG=en_GB.UTF-8
LC_CTYPE=C
LC_NUMERIC=C
LC_TIME=C
LC_COLLATE=C
LC_MONETARY=C
LC_MESSAGES=C
LC_PAPER=C
LC_NAME=C
LC_ADDRESS=C
LC_TELEPHONE=C
LC_MEASUREMENT=C
LC_IDENTIFICATION=C
LC_ALL=
So it seems salt is getting the wrong settings, when i look at the environ file for the salt process it has the correct environment variables. I have even run a sleep 100 command through salt so i can view the environment variables for the spawned salt process but that too has the correct environment settings. I have tried adding a locale.conf file with the correct settings but no different to salt.
Here is the locale.conf file:
LANG=en_GB.UTF-8
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER="en_GB.UTF-8"
LC_NAME="en_GB.UTF-8"
LC_ADDRESS="en_GB.UTF-8"
LC_TELEPHONE="en_GB.UTF-8"
LC_MEASUREMENT="en_GB.UTF-8"
LC_IDENTIFICATION="en_GB.UTF-8"
LC_ALL="en_GB.UTF-8"
I can add in export lines to my tomcat config files to force the correct variables but thats a work around to the problem, i really need to find where salt gets its configuration to alter it.
Where else can i look to find where salt is getting these incorrect locale settings? I believe it is almost definitely a salt problem.