jails unset LC_ALL

Hello,

can someone tell how I can unset LC_ALL? I am trying to install smoking inside a jail. When I try to reach the webfrostend I get this error
Code:
Resetting LC_NUMERIC failed probably because your international setup of the LC_ALL to "C.UTF-8" is overriding LC_NUMERIC.  Setting LC_ALL is not compatible with smokeping... at /usr/local/smokeping/lib/Smokeping.pm line 41.
Compilation failed in require at /usr/local/bin/smokeping_cgi line 15.
BEGIN failed--compilation aborted at /usr/local/bin/smokeping_cgi line 15.

my locale looks like this:
Code:
root@mon:~ # locale
LANG=C.UTF-8
LC_CTYPE="C.UTF-8"
LC_COLLATE="C.UTF-8"
LC_TIME="C.UTF-8"
LC_NUMERIC="C.UTF-8"
LC_MONETARY="C.UTF-8"
LC_MESSAGES="C.UTF-8"
LC_ALL=C.UTF-8

any help or hints highly appreciated

Henning
 
Look in your ~/.cshrc (for the C shells) and ~/.profile (for the bourne shells).
 
I added
Code:
export LC_ALL=""
to the .profile of the root user but it did noch change the output of
Code:
locale
. And where would you add it as system default so that the it will work for smokeping as well? Or am i getting something completely wrong?
 
Maybe you added it to /etc/login.conf at some point in time?

And remove that export LC_ALL="" from ~/.profile again. The variable would still be defined, but would contain an empty string.
 
The jail is quite simple and the /etc/login.conf is standard. Here is the part regarding the defaults:
Code:
default:\
    :passwd_format=sha512:\
    :copyright=/etc/COPYRIGHT:\
    :welcome=/etc/motd:\
    :setenv=BLOCKSIZE=K:\
    :mail=/var/mail/$:\
    :path=/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin ~/bin:\
    :nologin=/var/run/nologin:\
    :cputime=unlimited:\
    :datasize=unlimited:\
    :stacksize=unlimited:\
    :memorylocked=64K:\
    :memoryuse=unlimited:\
    :filesize=unlimited:\
    :coredumpsize=unlimited:\
    :openfiles=unlimited:\
    :maxproc=unlimited:\
    :sbsize=unlimited:\
    :vmemoryuse=unlimited:\
    :swapuse=unlimited:\
    :pseudoterminals=unlimited:\
    :kqueues=unlimited:\
    :umtxp=unlimited:\
    :priority=0:\
    :ignoretime@:\
    :umask=022:
 
If you're on 12.x that login.conf looks fine. Next files to check, /etc/profile and /etc/csh.cshrc.

Another thing that crossed my mind, how are you accessing the jail? Depending on how you access it you may have inherited it from the host.
 
When it comes to origin of LC_* vars check if /etc/ssh/sshd_config doesn't allow env variables being set by AcceptEnv. FreeBSD doesn't set it by default but this can mess things up too.
 
Depending on how you access it you may have inherited it from the host.
It looks like the locale environment is indeed inherited from the host depending how the jail is accessed.

Tested on host and jail 13.1-RELEASE.

Code:
Jail /etc/login.conf:

default:\
        ... 
        :umask=022:

jail # cap_mkdb /etc/login.conf

Code:
host # jexec <jail> locale 
LANG=C.UTF-8
LC_CTYPE="C.UTF-8"
LC_COLLATE="C.UTF-8"
LC_TIME="C.UTF-8"
LC_NUMERIC="C.UTF-8"
LC_MONETARY="C.UTF-8"
LC_MESSAGES="C.UTF-8"
LC_ALL=

Code:
host # setenv LANG C

host # jexec <jail> locale 
LANG=C
LC_CTYPE="C"
LC_COLLATE="C"
LC_TIME="C"
LC_NUMERIC="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_ALL=

Code:
host # ssh user@jail

jail # locale 
LANG=C
LC_CTYPE="C"
LC_COLLATE="C"
LC_TIME="C"
LC_NUMERIC="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_ALL=
 
Best way to access a jail (from the host) is jexec <jail> /usr/bin/login -f root. Not only will this register a root login, it will also wipe the environment you may be inadvertently spilling over to the jail.
 
okay this is getting a bit over my head as I almost always use iocage as my jail manager ;-). But what about processes that are running inside of the jail? how is getting smokeping or www the locale that produces that problem?
 
how is getting smokeping or www the locale that produces that problem?
You probably have LC_ALL set on the host. Not sure how iocage gives you a 'console', but if it's something like jexec <jail> /bin/sh then that shell will simply inherit the (exported) variables from your current shell.
But what about processes that are running inside of the jail?
Processes within that jail don't inherit anything, they get spawned by init(8) (which runs in it's own namespace in the host's kernel), via various rc(8) scripts.
 
Back
Top