Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFE: provide /proc/sys/kernel/random/boot_id #3027

Closed
smoser opened this issue Jun 4, 2019 · 5 comments · Fixed by #3034
Closed

RFE: provide /proc/sys/kernel/random/boot_id #3027

smoser opened this issue Jun 4, 2019 · 5 comments · Fixed by #3034
Assignees

Comments

@smoser
Copy link
Contributor

smoser commented Jun 4, 2019

As originally filed in ubuntu at bug 1831258 journalctl --list-boots identifies boots by reading /proc/sys/kernel/random/boot_id. Without doing this, the journal can only detect a reboot if the host has rebooted.

Without this ability to detect boots, functionality like journalctl --boot=X will also not work.

nspawn seems to do something similar in nspawn/nspawn.c:setup_boot_id

@brauner
Copy link
Member

brauner commented Jun 4, 2019

This is the wrong place. This should be done by the container at startup.

@xnox
Copy link
Contributor

xnox commented Jun 4, 2019

@brauner Where is the project for container startup? lxc? lxd? at first this looks no different to faking /proc/uptime. Cause each time /proc/uptime is faked, boot_id should be faked too. Or is this used for dynamic /proc files only, and static /proc files are faked somewhere else in container startup? I'm failing to find similar example as to where this should live then.

@brauner
Copy link
Member

brauner commented Jun 4, 2019

@brauner Where is the project for container startup? lxc? lxd? at first this looks no different to faking /proc/uptime. Cause each time /proc/uptime is faked, boot_id should be faked too. Or is this used for dynamic /proc files only, and static /proc files are faked somewhere else in container startup? I'm failing to find similar example as to where this should live then.

This should live in liblxc.

@brauner
Copy link
Member

brauner commented Jun 4, 2019

And be done at lxc_setup() time.

@stgraber stgraber transferred this issue from lxc/lxcfs Jun 4, 2019
@stgraber
Copy link
Member

stgraber commented Jun 4, 2019

Transferred over to liblxc, the runtime can indeed setup a memfd or something, put a uuid in there and bind-mount it (read-only) over the /proc file when it's in charge of mounting proc.

@brauner brauner self-assigned this Jun 4, 2019
brauner pushed a commit to brauner/lxc that referenced this issue Jun 5, 2019
Closes lxc#3027.

BugLink: https://bugs.launchpad.net/bugs/1831258
Cc: Dimitri John Ledkov <xnox@ubuntu.com>
Cc: Scott Moser <smoser@ubuntu.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
brauner pushed a commit to brauner/lxc that referenced this issue Jun 5, 2019
Closes lxc#3027.

BugLink: https://bugs.launchpad.net/bugs/1831258
Cc: Dimitri John Ledkov <xnox@ubuntu.com>
Cc: Scott Moser <smoser@ubuntu.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
brauner pushed a commit to brauner/lxc that referenced this issue Jun 5, 2019
Closes lxc#3027.

BugLink: https://bugs.launchpad.net/bugs/1831258
Cc: Dimitri John Ledkov <xnox@ubuntu.com>
Cc: Scott Moser <smoser@ubuntu.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
brauner pushed a commit to brauner/lxc that referenced this issue Jun 5, 2019
Closes lxc#3027.

BugLink: https://bugs.launchpad.net/bugs/1831258
Cc: Dimitri John Ledkov <xnox@ubuntu.com>
Cc: Scott Moser <smoser@ubuntu.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
brauner pushed a commit that referenced this issue Jun 13, 2019
Closes #3027.

BugLink: https://bugs.launchpad.net/bugs/1831258
Cc: Dimitri John Ledkov <xnox@ubuntu.com>
Cc: Scott Moser <smoser@ubuntu.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

4 participants