* systemd and /etc/machine-id
@ 2017-03-05 9:40 Nicolas Dechesne
2017-03-05 16:15 ` Patrick Ohly
0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Dechesne @ 2017-03-05 9:40 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
[-- Attachment #1: Type: text/plain, Size: 1339 bytes --]
hi,
I am trying to understand why the systemd recipe creates an empty
/etc/machine-id file:
# Create machine-id
# 20:12 < mezcalero> koen: you have three options: a) run
systemd-machine-id-setup at install time, b) have / read-only and an empty
file there (for stateless) and c) boot with / writable
touch ${D}${sysconfdir}/machine-id
Having an empty machine-id file seems to prevent the "ConditionFirstBoot"
to be ever met, e.g. I have a service that tries to use it, and at first
boot i am seeing in systemctl status:
ConditionFirstBoot=yes was not met
However I also notice that /etc/machine-id is properly set during the first
boot (e.g. with a valid UID). I am not sure I understand our intent to
create an empty file. If I remove the empty file before flashing the board,
then my service which depends on ConditionFirstBoot is executed properly,
and becasue the systemd recipe also enables 'firstboot' by default (in
PACKAGECONFIG) then systemd-firstboot service is kicked as well, and ask
for hostname , TZ, .. (which isn't very convenient neither).
without understanding the entire history, I would tend to think that we
need the following changes to the systemd recipe:
1. remove the empty /etc/machine-id file
2. remove firstboot from default PACKAGECONFIG
any thoughts?
cheers
nico
[-- Attachment #2: Type: text/html, Size: 1617 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: systemd and /etc/machine-id
2017-03-05 9:40 systemd and /etc/machine-id Nicolas Dechesne
@ 2017-03-05 16:15 ` Patrick Ohly
0 siblings, 0 replies; 2+ messages in thread
From: Patrick Ohly @ 2017-03-05 16:15 UTC (permalink / raw)
To: Nicolas Dechesne; +Cc: Patches and discussions about the oe-core layer
On Sun, 2017-03-05 at 10:40 +0100, Nicolas Dechesne wrote:
> hi,
>
> I am trying to understand why the systemd recipe creates an
> empty /etc/machine-id file:
>
> # Create machine-id
>
> # 20:12 < mezcalero> koen: you have three options: a) run
> systemd-machine-id-setup at install time, b) have / read-only and an
> empty file there (for stateless) and c) boot with / writable
> touch ${D}${sysconfdir}/machine-id
It's probably done for case b, the read-only rootfs (both when never
mounted read/write and when initially read-only until fsck completes).
systemd mounts a temporary machine-id over the empty file while the
rootfs is read-only. This is definitely needed for the permanently
read-only rootfs, because several services (for example, journald, if I
remember correctly) do not run without a valid machine-id.
I'm not 100% sure whether the "read-only initially" case also needs the
file. If not, then perhaps it can be limited to images with "read-only"
in IMAGE_FEATURES?
> Having an empty machine-id file seems to prevent the
> "ConditionFirstBoot" to be ever met, e.g. I have a service that tries
> to use it, and at first boot i am seeing in systemctl status:
>
> ConditionFirstBoot=yes was not met
When the rootfs is read-only permanently, does this condition still make
sense? Probably not, because each boot would be considered a "first
boot". Just wondering how this condition could be handled better.
--
Best Regards, Patrick Ohly
The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-03-05 16:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-05 9:40 systemd and /etc/machine-id Nicolas Dechesne
2017-03-05 16:15 ` Patrick Ohly
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox