/etc/machine-id not created if missing
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
systemd (Ubuntu) |
Won't Fix
|
Low
|
Unassigned |
Bug Description
If /etc/machine-id is missing at boot, systemd does not create it.
I came across lp:1387090 in which Martin Pitt mentions that it should be created if missing, but is unsure why this doesn't work.
I'm likewise unsure why it doesn't work, but this bit from dmesg makes me think it *might* be because systemd is trying to do so while the rootfs is still mounted read-only, before it gets remounted read-write:
[ 19.240451] systemd[1]: System cannot boot: Missing /etc/machine-id and /etc is mounted read-only.
[ 19.240464] systemd[1]: Booting up is supported only when:
[ 19.240466] systemd[1]: 1) /etc/machine-id exists and is populated.
[ 19.240467] systemd[1]: 2) /etc/machine-id exists and is empty.
[ 19.240468] systemd[1]: 3) /etc/machine-id is missing and /etc is writable.
A missing /etc/machine-id file has broad consequences for the boot process. As one example, the Journal Service doesn't get started.
This problem appears to have greater impact now that on Wily (desktop) /var/lib/
Note that on Wily server /var/lib/
Thanks!
ProblemType: Bug
DistroRelease: Ubuntu 15.10
Package: systemd 225-1ubuntu9
ProcVersionSign
Uname: Linux 4.2.0-16-generic x86_64
ApportVersion: 2.19.1-0ubuntu3
Architecture: amd64
CurrentDesktop: Unity
Date: Wed Oct 21 19:57:58 2015
JournalErrors:
No journal files were found.
-- No entries --
MachineType: System76, Inc. Gazelle Professional
ProcKernelCmdLine: BOOT_IMAGE=
SourcePackage: systemd
UdevLog: Error: [Errno 2] No such file or directory: '/var/log/udev'
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 05/16/2012
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: 4.6.5
dmi.board.
dmi.board.name: Gazelle Professional
dmi.board.vendor: System76, Inc.
dmi.board.version: gazp7
dmi.chassis.
dmi.chassis.type: 9
dmi.chassis.vendor: No Enclosure
dmi.chassis.
dmi.modalias: dmi:bvnAmerican
dmi.product.name: Gazelle Professional
dmi.product.
dmi.sys.vendor: System76, Inc.
description: | updated |
I'm surprised the root filesystem is read-only at the point where systemd starts. Isn't it remounted rw by the initramfs? (It is in Debian.)
From context on lp:1508697 you're using some sort of "golden image" creation process: install once, delete unique IDs and other transient state, then dd the image onto multiple machines and let the boot process re-populate those unique IDs.
If your image creation process truncated /etc/machine-id to 0 bytes instead of deleting it altogether, then systemd would be able to do tricks with bind-mounts to populate it; that's what Debian Live does. However, I'm not sure how/whether the newly generated ID gets written to the filesystem when it becomes rw.