#58: locale.conf has locale which is not installed, breaking systemd services -----------------------------+--------------------- Reporter: adelton | Owner: kanarip Type: defect | Status: new Priority: major | Milestone: Component: kickstart pool | Keywords: Blocked By: | Blocking: -----------------------------+--------------------- = bug description =
The /etc/locale.conf contains
{{{ LANG="en_US.UTF-8" }}}
The value is then set for services started by systemd, leading to errors. For example
Dockerfile:
{{{ FROM fedora:21 ENV container docker RUN systemctl mask systemd-remount-fs.service dev-hugepages.mount systemd- logind.service getty.target # dnf-makecache.service dnf-makecache.timer RUN sed -i 's/OOMScoreAdjust=-900//' /usr/lib/systemd/system/dbus.service ADD test-locale.service /etc/systemd/system/test-locale.service RUN systemctl enable test-locale.service VOLUME [ "/tmp", "/run" ] CMD [ "/usr/sbin/init" ] LABEL RUN "docker run -ti -v /sys/fs/cgroup:/sys/fs/cgroup:ro ${NAME}" }}}
test-locale.service:
{{{ [Unit] Description=Test sort
[Service] Type=oneshot ExecStart=/usr/bin/python -c 'import locale; locale.setlocale(locale.LC_ALL, "");'
[Install] WantedBy=multi-user.target }}}
Running container built from the above will show error
{{{ [ OK ] Reached target Sockets. [ OK ] Reached target Basic System. Starting Test sort... Starting Permit User Sessions... Starting D-Bus System Message Bus... [ OK ] Started D-Bus System Message Bus. [FAILED] Failed to start Test sort. See "systemctl status test-locale.service" for details. [ OK ] Started Permit User Sessions. Starting Cleanup of Temporary Directories... [ OK ] Reached target Multi-User System. }}}
and {{{journalctl}}} will show
{{{ Oct 22 11:31:53 6d871a9aa693 systemd[1]: Reached target Timers. Oct 22 11:31:53 6d871a9aa693 systemd[1]: Starting D-Bus System Message Bus Socket. Oct 22 11:31:53 6d871a9aa693 python[28]: Traceback (most recent call last): Oct 22 11:31:53 6d871a9aa693 python[28]: File "<string>", line 1, in <module> Oct 22 11:31:53 6d871a9aa693 python[28]: File "/usr/lib64/python2.7/locale.py", line 579, in setlocale Oct 22 11:31:53 6d871a9aa693 python[28]: return _setlocale(category, locale) Oct 22 11:31:53 6d871a9aa693 python[28]: locale.Error: unsupported locale setting Oct 22 11:31:53 6d871a9aa693 systemd[1]: test-locale.service: main process exited, code=exited, status=1/FAILURE Oct 22 11:31:53 6d871a9aa693 systemd[1]: Failed to start Test sort. Oct 22 11:31:53 6d871a9aa693 systemd[1]: Unit test-locale.service entered failed state. Oct 22 11:31:53 6d871a9aa693 systemd[1]: test-locale.service failed. Oct 22 11:31:53 6d871a9aa693 systemd[1]: Started Permit User Sessions. }}}
= bug analysis =
/etc/locale.conf sets locale which is not installed.
= fix recommendation =
It is possible to workaround with
{{{ RUN echo LANG=POSIX > /etc/locale.conf }}}
but if the base image limits the list of locales that are installed, it should also set the proper value to /etc/locale.conf.