Description of problem:
The /proc/sys/kernel/random/boot_id file provides a UUID that changes on each boot of a machine. The original intent was to allow emacs to determine if a lockfile for a PID was stale. systemd now also uses this UUID to tag log messages in the journal allowing query of logs per boot up.
The data for this file needs to be containerized so that apps can sensibly use it inside an LXC container. Based on discussion on the containers mailing list:
We need to patch the kernel such that
- Associate '/proc/sys/kernel/random/boot_id' with the pid namespace
- Allow boot_id to be written to, only if it has not yet been
read in the current pid namespace. (for migration use case)
- Lazy generate a UUID for boot_id on first read in the current pid
namespace, only if it has not previously been written to.
- Add file to Documentation/ explaining the use case for the boot_id
file and its semantics wrt to namespaces.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. cat /proc/sys/kernel/random/boot_id
2. unshare --pid cat /proc/sys/kernel/random/boot_id
Hmm, I am not actually convinced that this really should be fixed in the kernel rather than in userspace.
Overmounting the boot id in userspace is very easy, so I'd suggest doing this all in userspace where necessary.
Daniel, any objections? If not, I'll close the bug.
Yeah, upstream didn't paticularly want to do it this way either