On Friday, April 26, 2013 at 3:01 PM, AJ Christensen wrote:
Use the 'environment' parameter to the execute resource to setenvironment variables, i.e;execute 'locale'environment 'LC_CTYPE' => 'en_US.UTF-8'command 'locale | tee /tmp/locale.txt'endCheers,AJ
On 27 April 2013 09:59, Harry Yeh < "> > wrote:Tried thiaexecute "locale" docommand "LC_CTYPE=en_US.UTF-8locale >> /tmp/locale.txt"endthat even shows up asLC_CTYPE=CYou can try itOn Fri, Apr 26, 2013 at 1:27 AM, < "> > wrote:Currently I'm using chef 11 (just upgraded, hoping the problem would goawaybut it hasn't!)So here's my problem.When I type the command "locale" on my ubuntu machine the default output Igetis the following:LANG=en_US.UTF-8LANGUAGE=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=Assume that I have a cook book that will write a locale to a temp file inarecipe and cookbookknife node run_list add server1 recipe[writelocale]the following is the contents of the recipe/writelocale.rbexecute "locale" docommand "locale >> /tmp/locale.txt"endWhen I run this commandknife ssh name:server1 -x root -P password1 -a ipaddress "sudo -ichef-client"to run a recipe remotely I always end up with this.LANG=en_US.UTF-8LANGUAGE=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=I'm guessing it has something to do with the shell or how chef-server iscausing the remote ssh shell to execute. I only thing I can think of thereissome chef process whether it's RabbitMQ or something else that is changingthedefault shell locale to C vs UTT-8. I've tried numerous things, includingtrying to set the LC_TYPE="en_US.UTF-8" but I can't seem to do it, thelocalealways default to C. This is particularly a problem when I try to installthings like Postgresql, since I end up with the following instead of whatIactually need.What I should SeeList of databasesName | Owner | Encoding | Collate | Ctype | Accessprivileges-----------+----------+----------+-------------+-------------+-----------------------postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres+| | | | |postgres=CTc/postgrestemplate1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres+| | | | |postgres=CTc/postgresWhen I remote and run apt-get install -y postgresql-server-dev-9.1List of databasesName | Owner | Encoding | Collate | Ctype | Access privileges-----------+----------+-----------+---------+-------+-----------------------postgres | postgres | SQL_ASCII | C | C |template0 | postgres | SQL_ASCII | C | C | =c/postgres+| | | | |postgres=CTc/postgrestemplate1 | postgres | SQL_ASCII | C | C | =c/postgres+| | | | |postgres=CTc/postgresI've been stuck on this issue for a few days now seems trivial at firstbutit's become and issue since it affects what packages I can install withtheProper Locale.Please help thanks!--Harry YehCEO / CTOComet Computing(604)304-1603Twitter: http://twitter.com/harryyehFacebook: http://www.facebook.com/harryyehConfidentiality Notice:This electronic mail transmission and any accompanying attachments containconfidential information intended only for the use of the individual orentity named above. Any dissemination, distribution, copying or action takenin reliance on the contents of this communication by anyone other than theintended recipient is strictly prohibited. If you have received thiscommunication in error please immediately delete the E-mail and notify thesender at the above E-mail address.
Archive powered by MHonArc 2.6.16.