• Harald Hoyer's avatar
    Do not serialize environment, when switching root · b3680f49
    Harald Hoyer authored
    When switching root, i.e. LANG can be set to the locale of the initramfs
    or "C", if it was unset. When systemd deserializes LANG in the real root
    this would overwrite the setting previously gathered by locale_set().
    To reproduce, boot with an initramfs without locale.conf or change
    /etc/locale.conf to a different language than the initramfs and check a
    daemon started by systemd:
    $ tr "$\000" '\n' </proc/$(pidof sshd)/environ | grep LANG
    To prevent that, serialization of environment variables is skipped, when
    serializing for switching root.
manager.h 9.35 KB