Search code examples
javalinuxjenkinslocale

Jenkins Linux Slave Locale


I have Jenkins setup as master on a Windows machine. I am trying to connect a Linux machine as a slave with JNLP using the following command:

/usr/java/latest/bin/java -jar /home/devjenkins/slave/slave.jar -jnlpUrl "$JNLP_URL"

where JNLP_URL is the url to connect with the master Jenkins. The connection connects successfully and I am able to run jobs on the slave machine.

The problem that I have not managed to solve is setting the Locale on the slave machine which for some reason seems to be defaulting to en_US.utf8 instead of en_GB.utf8. When connecting through SSH to this linux machine with the same user as the jenkins slave, the locale is resolving correctly to en_GB.utf8.

I tried setting an environment variable to the node configuration in Jenkins master LANG=en_GB.utf8 but when viewing the system information from nodes > slavemachine > system information, the Environment Variables refer to the property LANG en_US.UTF-8.

Any ideas where this property is being set and how can I override this value?


Solution

  • I managed to solve this issue by using the option to use SSH to connect to the jenkins slave. Through this option, jenkins creates the setup on the slave machine via SSH and starts the slave.jar process. Most probably, it was a bug in Jenkins that does not update/override the language when using Java Web start.