systemd-localed requires read-only-etc hacks for /etc/vconsole.conf and /etc/locale.conf
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
systemd (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
Noble |
Fix Released
|
Medium
|
Nick Rosbrook |
Bug Description
[Impact]
Ubuntu Core has a read-only /etc, but a writable partition in /etc/writable. In some versions of Ubuntu, the systemd package ships a patch to follow symlinks from /etc/ -> /etc/writable, e.g. for files like /etc/locale.conf.
In Core24, this patch needs to be expanded for /etc/locale.conf and /etc/vconsole.conf in systemd-localed.
[Test Plan]
1. On a pristine Ubuntu Core system, run "localectl status". Verify that the system locale is set to the default (seems to be "C.UTF-8" based on the current core24 snap).
2. Modify the system locale by running "localectl set-locale LANG=en_AU.UTF-8". The command should complete without error.
3. Check that the locale has changed by running "localectl status".
4. Check that the locale has been saved to /etc/locale.conf
5. Reboot the system, and run "localectl status" again to check that the change has persisted.
[Where problems could occur]
This hack is designed to be a no-op in non-Ubuntu Core cases. I.e., when /etc/writable does not exist or does not have a link for the given path in etc, the original path is used.
As is evident by the ever-expanding nature of this patch, this is not a complete solution. It's possible that more cases will be found where this hack needs to be applied.
[Other information]
This patch is not carried in supported releases newer than Noble. While this patch is far from ideal, expanding this hack has become the go-to for existing stable releases.
Changed in systemd (Ubuntu): | |
status: | New → Invalid |
Changed in systemd (Ubuntu Noble): | |
status: | New → Triaged |
importance: | Undecided → Medium |
assignee: | nobody → Nick Rosbrook (enr0n) |
description: | updated |
tags: |
added: verification-done verification-done-noble removed: verification-needed verification-needed-noble |
As far as a test plan goes, I think this can mostly be done using the localectl tool that is already shipped in the base snap. This exercises the same D-Bus API that higher level tools like ubuntu-desktop-init use. As a command line tool, it could likely be used by a spread test.
To test system locale changes, it might look something like this:
1. On a pristine Ubuntu Core system, run "localectl status". Verify that the system locale is set to the default (seems to be "C.UTF-8" based on the current core24 snap).
2. Modify the system locale by running "localectl set-locale LANG=en_AU.UTF-8". The command should complete without error.
3. Check that the locale has changed by running "localectl status".
4. Check that the locale has been saved to /etc/locale.conf
5. Reboot the system, and run "localectl status" again to check that the change has persisted.
Testing the key map changes is a little more difficult, since the relevant commands have been patched out of our localectl:
$ localectl set-keymap foo
Setting X11 and console keymaps is not supported in Debian.
It should still be possible to call the D-Bus API directly via "busctl call", but it will be a bit more verbose. Longer term, it might be worth looking at whether we can drop the patch that disables set-keymap.