journalctl --list-boots does not recognize boots in a container

Bug #1831258 reported by Scott Moser
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lxc (Ubuntu)
Fix Released
Undecided
Unassigned
Bionic
Fix Committed
Undecided
Unassigned
Eoan
Fix Committed
Undecided
Unassigned
lxd (Ubuntu)
Invalid
Undecided
Unassigned
Bionic
Invalid
Undecided
Unassigned
Eoan
Invalid
Undecided
Unassigned
systemd (Ubuntu)
Invalid
Undecided
Unassigned
Bionic
Invalid
Undecided
Unassigned
Eoan
Invalid
Undecided
Unassigned

Bug Description

$ lxc launch ubuntu-daily:eoan devel1
$ sleep 10 # wait for boot

$ lxc exec devel1 /bin/bash
root@devel1:~# cat /proc/uptime
183.00 173.00
root@devel1:~# cat /etc/cloud/build.info
build_name: server
serial: 20190531
root@devel1:~# lsb_release -sc
eoan

root@devel1:~# journalctl --no-pager --list-boots
 0 4ecd6fb081964b75b1ddc09baf1be3d9 Fri 2019-05-31 14:58:48 UTC—Fri 2019-05-31 15:06:10 UTC
root@devel1:~# reboot
root@devel1:~#

$ lxc exec devel1 /bin/bash
## verify the reboot happened
root@devel1:~# cat /proc/uptime
12.00 6.00
## but journalctl only shows the same boot it did before.
root@devel1:~# journalctl --no-pager --list-boots
 0 4ecd6fb081964b75b1ddc09baf1be3d9 Fri 2019-05-31 14:58:48 UTC—Fri 2019-05-31 15:09:10 UTC

ProblemType: Bug
DistroRelease: Ubuntu 19.10
Package: systemd 240-6ubuntu5
ProcVersionSignature: Ubuntu 4.15.0-50.54-generic 4.15.18
Uname: Linux 4.15.0-50-generic x86_64
ApportVersion: 2.20.11-0ubuntu2
Architecture: amd64
Date: Fri May 31 15:06:24 2019
MachineType: LENOVO 20KGS3Y900
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 LANG=C.UTF-8
ProcKernelCmdLine: BOOT_IMAGE=/vmlinuz-4.15.0-50-generic root=UUID=25df9069-80c7-46f4-a47c-305613c2cb6b ro quiet splash vt.handoff=1
SourcePackage: systemd
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 04/20/2019
dmi.bios.vendor: LENOVO
dmi.bios.version: N23ET63W (1.38 )
dmi.board.asset.tag: Not Available
dmi.board.name: 20KGS3Y900
dmi.board.vendor: LENOVO
dmi.board.version: SDK0J40697 WIN
dmi.chassis.asset.tag: No Asset Information
dmi.chassis.type: 10
dmi.chassis.vendor: LENOVO
dmi.chassis.version: None
dmi.modalias: dmi:bvnLENOVO:bvrN23ET63W(1.38):bd04/20/2019:svnLENOVO:pn20KGS3Y900:pvrThinkPadX1Carbon6th:rvnLENOVO:rn20KGS3Y900:rvrSDK0J40697WIN:cvnLENOVO:ct10:cvrNone:
dmi.product.family: ThinkPad X1 Carbon 6th
dmi.product.name: 20KGS3Y900
dmi.product.version: ThinkPad X1 Carbon 6th
dmi.sys.vendor: LENOVO

Revision history for this message
Scott Moser (smoser) wrote :
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Hahahhahaha

So....

yeah....

because the _host_ bootid is in use =) and you didn't reboot the host. Specifically, everything in systemd reads /proc/sys/kernel/random/boot_id and that appears to be the same as on the host.

Maybe lxc/lxd should fake that file and generate new "boot_id" each time container is started.

Changed in systemd (Ubuntu Bionic):
status: New → Invalid
Changed in systemd (Ubuntu Eoan):
status: New → Invalid
Revision history for this message
Christian Brauner (cbrauner) wrote :

Several people tried to namespace this but this is really tied to a physical machine so it's kinda tricky to fake.

Revision history for this message
Scott Moser (smoser) wrote :

Filed issue with lxcfs at
https://github.com/lxc/lxcfs/issues/285

Revision history for this message
Christian Brauner (cbrauner) wrote :
Changed in lxd (Ubuntu Bionic):
status: New → In Progress
Changed in lxd (Ubuntu Eoan):
status: New → In Progress
Changed in systemd (Ubuntu Bionic):
status: Invalid → In Progress
Changed in systemd (Ubuntu Eoan):
status: Invalid → In Progress
Changed in systemd (Ubuntu Bionic):
status: In Progress → Invalid
Changed in systemd (Ubuntu Eoan):
status: In Progress → Invalid
Changed in lxc (Ubuntu Bionic):
status: New → Incomplete
status: Incomplete → Fix Committed
Changed in lxc (Ubuntu Eoan):
status: New → Fix Committed
Changed in lxd (Ubuntu Bionic):
status: In Progress → Invalid
Changed in lxd (Ubuntu Eoan):
status: In Progress → Invalid
Changed in lxc (Ubuntu):
status: Fix Committed → Fix Released
status: Fix Released → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lxc - 1:4.0.0-0ubuntu2

---------------
lxc (1:4.0.0-0ubuntu2) focal; urgency=medium

  * Cherry-pick upstream bugfixes:
    - 0036-fix-non-root-user-cannot-write-dev-stdout.patch
    - 0037-cgroups-fix-uninitialized-transient_len-warning.patch
    - 0038-utils-rework-fix_stdio_permissions.patch
    - 0039-utils-use-setres-u-g-id-in-lxc_switch_uid_gid.patch
    - 0040-cgroups-fix-build-warning-on-GCC-7.patch
    - 0041-lxccontainer-poll-takes-millisecond-not-seconds.patch

 -- Stéphane Graber <email address hidden> Thu, 02 Apr 2020 12:25:20 -0400

Changed in lxc (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.