vlgrevtsev, could you check the default environment variables that systemd sets? It should be something like this on a Juju-provisioned machine:
sudo systemctl show-environment LANG=C.UTF-8 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
Juju itself does not alter cloud-init defaults so cloud-init should just set the locale to C.UTF-8 and it will be used by all daemons spawned by it:
2021-06-22 16:00:28,183 - handlers.py[DEBUG]: start: modules-config/config-locale: running config-locale with frequency once-per-instance 2021-06-22 16:00:28,183 - util.py[DEBUG]: Writing to /var/lib/cloud/instances/cb2fb8ce-ff5a-43b1-ab7d-dec891b503e9/sem/config_locale - wb: [644] 25 bytes 2021-06-22 16:00:28,184 - helpers.py[DEBUG]: Running config-locale using lock (<FileLock using file '/var/lib/cloud/instances/cb2fb8ce-ff5a-43b1-ab7d-dec891b503e9/sem/config_locale'>) 2021-06-22 16:00:28,184 - util.py[DEBUG]: Reading from /etc/default/locale (quiet=False) 2021-06-22 16:00:28,184 - util.py[DEBUG]: Read 13 bytes from /etc/default/locale 2021-06-22 16:00:28,219 - cc_locale.py[DEBUG]: Setting locale to C.UTF-8 2021-06-22 16:00:28,219 - debian.py[DEBUG]: System has 'LANG=C.UTF-8' requested 'C.UTF-8', skipping regeneration. 2021-06-22 16:00:28,219 - handlers.py[DEBUG]: finish: modules-config/config-locale: SUCCESS: config-locale ran successfully
As a result, daemons started via systemd should get the correct locale settings:
sudo cat /proc/<pid>/environ
The problem may be more involved since python processes in our case are started by Apache and run as WSGI daemon processes (not managed by systemd).
vlgrevtsev, could you check the default environment variables that systemd sets? It should be something like this on a Juju-provisioned machine:
sudo systemctl show-environment local/sbin: /usr/local/ bin:/usr/ sbin:/usr/ bin:/sbin: /bin:/snap/ bin
LANG=C.UTF-8
PATH=/usr/
Juju itself does not alter cloud-init defaults so cloud-init should just set the locale to C.UTF-8 and it will be used by all daemons spawned by it:
2021-06-22 16:00:28,183 - handlers.py[DEBUG]: start: modules- config/ config- locale: running config-locale with frequency once-per-instance cloud/instances /cb2fb8ce- ff5a-43b1- ab7d-dec891b503 e9/sem/ config_ locale - wb: [644] 25 bytes cloud/instances /cb2fb8ce- ff5a-43b1- ab7d-dec891b503 e9/sem/ config_ locale' >) py[DEBUG] : Setting locale to C.UTF-8 config/ config- locale: SUCCESS: config-locale ran successfully
2021-06-22 16:00:28,183 - util.py[DEBUG]: Writing to /var/lib/
2021-06-22 16:00:28,184 - helpers.py[DEBUG]: Running config-locale using lock (<FileLock using file '/var/lib/
2021-06-22 16:00:28,184 - util.py[DEBUG]: Reading from /etc/default/locale (quiet=False)
2021-06-22 16:00:28,184 - util.py[DEBUG]: Read 13 bytes from /etc/default/locale
2021-06-22 16:00:28,219 - cc_locale.
2021-06-22 16:00:28,219 - debian.py[DEBUG]: System has 'LANG=C.UTF-8' requested 'C.UTF-8', skipping regeneration.
2021-06-22 16:00:28,219 - handlers.py[DEBUG]: finish: modules-
As a result, daemons started via systemd should get the correct locale settings:
sudo cat /proc/<pid>/environ
The problem may be more involved since python processes in our case are started by Apache and run as WSGI daemon processes (not managed by systemd).