Page MenuHomePhabricator

How do I control the locale on the grid
Closed, ResolvedPublic

Description

The same program runs OK on the login server and different on the grid; and I suspect this causes me some perobles because I use Hebrew

tools.bothasava@tools-bastion-03:~$ locale
LANG=en_US.UTF-8
LANGUAGE=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8

But:

tools.bothasava@tools-bastion-03:~$ jsub -l release=trusty locale
tools.bothasava@tools-bastion-03:~$ cat locale.out
LANG=
LANGUAGE=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

when I look at the *.out files from the grid I get lots of ??????????s; When I run it on the login server (bastion) I get Hebrew text.

Thanks

Event Timeline

This did the trick

jsub -l release=trusty -v LC_ALL=en_US.UTF-8  locale

tools.bothasava@tools-bastion-03:~$ cat locale.out
LANG=
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8
Kotz claimed this task.

This did the trick

jsub -l release=trusty -v LC_ALL=en_US.UTF-8  locale

tools.bothasava@tools-bastion-03:~$ cat locale.out
LANG=
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8

@Kotz, did you find that in the docs somewhere or should we add it?

tools.zhuyifei1999-test@tools-bastion-02:~$ jsub -N localetest locale
Your job 7244952 ("localetest") has been submitted
tools.zhuyifei1999-test@tools-bastion-02:~$ cat localetest.out; rm localetest.out
LANG=
LANGUAGE=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=
tools.zhuyifei1999-test@tools-bastion-02:~$ jsub -N localetest bash -c "'"LC_ALL=en_US.UTF-8 locale"'"
Your job 7245044 ("localetest") has been submitted
tools.zhuyifei1999-test@tools-bastion-02:~$ cat localetest.out
LANG=
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8

"'" is used here because the arguments are un-escaped twice: once by the initial call jsub call by bash, then sge calls bash again to execute the command on the exec hosts (which is bad, I know, but you can create a small shell script to make it more sane).

You may be interested in T60784: Shell LOCALE neither consistent nor sane across grid engine nodes

@chasemp - No, I did not find it in the documentation; I thought the environment variable might do the trick and them I looked for qsub documentation to find -v.

@zhuyifei1999 - Thanks but I think my solution is more elegant and it basically do the same thing - although it does build on the jsub/qsub parameter -v

Basically my problem is the same as T60784 so thanks. I think an acceptable solution is to set the default to UTF8 and this will solve most all the problems. I'll write a comment there.

thanks again

@zhuyifei1999 - Thanks but I think my solution is more elegant and it basically do the same thing - although it does build on the jsub/qsub parameter -v

Well, yeah I must admit that I didn't read enough manuals... (was looking for a parameter -e for environment, but -v?! most places use -v for verbose...)