freeipa/daemons/ipa-otpd
Alexander Bokovoy 38a86e3367 systemd: enforce en_US.UTF-8 locale in systemd units
Python code does detection of the system encoding based on the locale
settings. On RHEL 8.4 development images we somehow get LANG=en_US which
defaults to iso8859-1 _inside_ the systemd-started service, even though
the whole environment defaults to LANG=en_US.UTF-8.

When instrumented with ExecStartPre=/usr/bin/locale, the following
output can be seen:

locale[45481]: LANG=en_US
locale[45481]: LC_CTYPE="en_US"
locale[45481]: LC_NUMERIC="en_US"
locale[45481]: LC_TIME="en_US"
locale[45481]: LC_COLLATE="en_US"
locale[45481]: LC_MONETARY="en_US"
locale[45481]: LC_MESSAGES="en_US"
locale[45481]: LC_PAPER="en_US"
locale[45481]: LC_NAME="en_US"
locale[45481]: LC_ADDRESS="en_US"
locale[45481]: LC_TELEPHONE="en_US"
locale[45481]: LC_MEASUREMENT="en_US"
locale[45481]: LC_IDENTIFICATION="en_US"
locale[45481]: LC_ALL=
ipactl[45483]: Unexpected error
ipactl[45483]: SystemEncodingError: System encoding must be UTF-8, 'iso8859-1' is not supported. Set LC_ALL="C.UTF-8", or LC_ALL="" and LC_CTYPE="C.UTF-8".
systemd[1]: ipa.service: Main process exited, code=exited, status=1/FAILURE

Set the environment to explicit LC_ALL=C.UTF-8 to please the Python
code. FreeIPA server side only cares about actual encoding, not the
language itself. We already use LC_ALL=C.UTF-8 in httpd service snippet.

Fixes: https://pagure.io/freeipa/issue/8617
Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Thomas Woerner <twoerner@redhat.com>
2020-12-10 14:38:05 +02:00
..
bind.c Properly handle LDAP socket closures in ipa-otpd 2016-10-06 10:35:25 +02:00
forward.c Add the krb5/FreeIPA RADIUS companion daemon 2013-05-17 09:30:51 +02:00
internal.h Migrate from #ifndef guards to #pragma once 2016-05-29 14:04:45 +02:00
ipa_otpd_queue_cmocka_tests.c Add cmocka unit tests for ipa otpd queue code 2018-08-31 21:01:46 +02:00
ipa-otpd.socket.in ipa-otpd.socket.in: Use a platform specific value for KDC service file 2017-04-12 16:17:51 +02:00
ipa-otpd@.service.in systemd: enforce en_US.UTF-8 locale in systemd units 2020-12-10 14:38:05 +02:00
main.c ipa-otpd: fix gcc complaints in Rawhide 2020-11-17 18:48:24 +02:00
Makefile.am Unify access to FQDN 2020-10-26 17:11:19 +11:00
parse.c Add the krb5/FreeIPA RADIUS companion daemon 2013-05-17 09:30:51 +02:00
query.c Properly handle LDAP socket closures in ipa-otpd 2016-10-06 10:35:25 +02:00
queue.c Clear next field when returnining list elements in queue.c 2018-08-31 21:01:46 +02:00
stdio.c Add the krb5/FreeIPA RADIUS companion daemon 2013-05-17 09:30:51 +02:00
test.py Py3: Replace six.moves imports 2018-10-05 12:06:19 +02:00