Bug 69821 - systemd environment is not updated after locale changes
Summary: systemd environment is not updated after locale changes
Status: RESOLVED FIXED
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: systemd-bugs
QA Contact: systemd-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-25 16:06 UTC by Rui Tiago Matos
Modified: 2013-10-04 15:39 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Rui Tiago Matos 2013-09-25 16:06:21 UTC
If I update the system locale with

localectl set-locale LANG=de_DE.utf8

I expect newly instanced services to run with the new locale, but this isn't the case.
Comment 1 Lennart Poettering 2013-09-25 16:53:21 UTC
This should work. What does "systemctl show-environment" print after you change the locale?
Comment 2 Rui Tiago Matos 2013-09-25 16:59:59 UTC
This is on F20 btw:

[root@localhost ~]# systemctl show-environment 
BOOT_IMAGE=/boot/vmlinuz-3.11.0-3.fc20.x86_64
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
LANG=en_US.UTF-8

[root@localhost ~]# localectl status
   System Locale: LANG=en_US.UTF-8
       VC Keymap: us
      X11 Layout: us

[root@localhost ~]# localectl set-locale LANG=de_DE.utf8

[root@localhost ~]# localectl status
   System Locale: LANG=de_DE.utf8
       VC Keymap: us
      X11 Layout: us

[root@localhost ~]# systemctl show-environment 
BOOT_IMAGE=/boot/vmlinuz-3.11.0-3.fc20.x86_64
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
LANG=en_US.UTF-8
Comment 3 Kay Sievers 2013-09-25 17:03:19 UTC
Seems all fine here:

# systemctl restart systemd-udevd
# xargs -0 -n1 < /proc/$(pidof systemd-udevd)/environ
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
LANG=en_US.UTF-8
LC_TIME=de_DE.UTF-8
LC_PAPER=de_DE.UTF-8
LC_MEASUREMENT=de_DE.UTF-8

# localectl set-locale LANG=en_US.utf8
# systemctl restart systemd-udevd
# xargs -0 -n1 < /proc/$(pidof systemd-udevd)/environ
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
LANG=en_US.utf8
NOTIFY_SOCKET=@/org/freedesktop/systemd1/notify
LISTEN_PID=2529
LISTEN_FDS=2
Comment 4 Kay Sievers 2013-09-25 18:10:55 UTC
> [root@localhost ~]# systemctl show-environment 
> BOOT_IMAGE=/boot/vmlinuz-3.11.0-3.fc20.x86_64

Are you sure you have an up-to-date initramfs, there should be no such
variables leaking from the kernel/inird into systemd in F20.
Comment 5 Rui Tiago Matos 2013-09-25 18:18:36 UTC
(In reply to comment #4)
> > [root@localhost ~]# systemctl show-environment 
> > BOOT_IMAGE=/boot/vmlinuz-3.11.0-3.fc20.x86_64
> 
> Are you sure you have an up-to-date initramfs, there should be no such
> variables leaking from the kernel/inird into systemd in F20.

Ok, I'm testing this on a VM which hadn't been updated in a few days. I updated only the kernel and systemd packages (systemd was at 206-9 and now is 207-4). Rebooted.

I'm still seeing this :-(

The BOOT_IMAGE variable doesn't show up in systemctl show-environment anymore though.
Comment 6 Zbigniew Jedrzejewski-Szmek 2013-10-03 14:32:35 UTC
Can you turn on debugging in systemd (kill -56 1) and run localectl again and attach the output? There should be a line like

  systemd[1]: Got D-Bus request: org.freedesktop.systemd1.Manager.UnsetAndSetEnvironment() on /org/freedesktop/systemd1
Comment 7 Rui Tiago Matos 2013-10-03 17:57:10 UTC
Ok, that was a good hint, seems like it's selinux that's denying us:

systemd[1]: Setting log level to debug.
systemd[1]: Got D-Bus request: org.freedesktop.DBus.NameOwnerChanged() on /org/freedesktop/DBus
systemd[1]: Got D-Bus request: org.freedesktop.DBus.NameOwnerChanged() on /org/freedesktop/DBus
systemd[1]: Got D-Bus request: org.freedesktop.DBus.NameOwnerChanged() on /org/freedesktop/DBus
systemd[1]: Got D-Bus request: org.freedesktop.DBus.NameOwnerChanged() on /org/freedesktop/DBus
systemd[1]: Accepted connection on private bus.
systemd[1]: Got D-Bus request: org.freedesktop.DBus.Properties.Get() on /org/freedesktop/systemd1
systemd[1]: SELinux access check scon=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tcon=system_u:system_r:init_t:s0 tclass=system perm=status path=(null) cmdline=systemctl show-environment: 0
systemd[1]: Got D-Bus request: org.freedesktop.DBus.Local.Disconnected() on /org/freedesktop/DBus/Local
systemd[1]: Got D-Bus request: org.freedesktop.DBus.NameOwnerChanged() on /org/freedesktop/DBus
systemd[1]: Got D-Bus request: org.freedesktop.DBus.NameOwnerChanged() on /org/freedesktop/DBus
polkitd[322]: Registered Authentication Agent for unix-process:1169:19037 (system bus name :1.44 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.utf8)
systemd[1]: Got D-Bus request: org.freedesktop.systemd1.Manager.UnsetAndSetEnvironment() on /org/freedesktop/systemd1
systemd[1]: SELinux policy denies access.
systemd[1]: SELinux access check scon=system_u:system_r:systemd_localed_t:s0 tcon=system_u:system_r:init_t:s0 tclass=system perm=reboot path=(null) cmdline=(null): -13
systemd-localed[942]: Failed to set locale information: Access denied
systemd-localed[942]: Changed locale information.
systemd[1]: Received SIGCHLD from PID 1170 (pkttyagent).
systemd[1]: Got SIGCHLD for process 1170 (pkttyagent)
systemd[1]: Child 1170 died (code=killed, status=15/TERM)
systemd[1]: Got D-Bus request: org.freedesktop.DBus.NameOwnerChanged() on /org/freedesktop/DBus
systemd[1]: Got D-Bus request: org.freedesktop.DBus.NameOwnerChanged() on /org/freedesktop/DBus
polkitd[322]: Unregistered Authentication Agent for unix-process:1169:19037 (system bus name :1.44, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.utf8) (disconnected from bus)


After a setenforce 0 it works fine. Closing this, thanks for the help.
Comment 8 Lennart Poettering 2013-10-04 15:15:48 UTC
Seems systemd was at least partially to blame as we requested "reboot" permissions from selinux, rather than "reload". Fixed in git now.

Also see:
https://bugzilla.redhat.com/show_bug.cgi?id=1015257


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.