dracut icon indicating copy to clipboard operation
dracut copied to clipboard

fix(systemd): set right permissions for the machine-id file

Open aafeijoo-suse opened this issue 3 years ago • 3 comments

Set the right permissions for the /etc/machine-id file.

Checklist

  • [X] I have tested it locally
  • [ ] I have reviewed and updated any documentation if relevant
  • [ ] I am providing new code and test(s) for it

Fixes #1864

aafeijoo-suse avatar Jul 15 '22 12:07 aafeijoo-suse

Writing uninitialized\n to it, according to https://systemd.io/BUILDING_IMAGES/

I think the first boot semantics makes no sense in initrd, hence etc/machine-id should be empty (https://www.freedesktop.org/software/systemd/man/machine-id.html#First%20Boot%20Semantics).

dtardon avatar Jul 18 '22 08:07 dtardon

Writing uninitialized\n to it, according to https://systemd.io/BUILDING_IMAGES/

I think the first boot semantics makes no sense in initrd, hence etc/machine-id should be empty (https://www.freedesktop.org/software/systemd/man/machine-id.html#First%20Boot%20Semantics).

Right, thanks for pointing me to the right place in the doc. The other place in the code (which is much more recent than this) that writes the machine-id if it's empty confused me.

https://github.com/dracutdevs/dracut/blob/fe8fa2b0cadbb33e27c8dd8b5851548dcd65835c/modules.d/35network-manager/module-setup.sh#L67-L73

aafeijoo-suse avatar Jul 18 '22 09:07 aafeijoo-suse

LGTM

LaszloGombos avatar Aug 06 '22 19:08 LaszloGombos