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

exclude /var/lib/dbus/machine-id from basefiles t… #14

Closed

Conversation

abezella
Copy link
Contributor

@abezella abezella commented Jan 18, 2022

this change updates the mk-basefile script to exclude /etc/machine-id and /var/lib/dbus/machine-id from basefiles to allow unique builds. in testing it appears that removing both is necessary (cf. SYSTEMD-MACHINE-ID-SETUP(1) "If a valid D-Bus machine ID is already configured [...]"). tested on a FOCAL64 basefile.

it is worth noting that the create_base function in bin/fai-make-nfsroot currently only excludes /etc/machine-id. likely this should be updated as well.

@abezella abezella closed this Jan 18, 2022
@abezella abezella reopened this Jan 18, 2022
@Mrfai
Copy link
Contributor

Mrfai commented Jan 21, 2022

We already create an empty machine-id in the basefile. IIRC an empty file is needed (and better than excluding the machine-id file from the tar file) for the boot process to regenerate a new id during the first boot.

I cannot see that /var/lib/dbus/machine-id is included into the base files I create, so I wonder why this patch is needed.
Any ideas, logs that show why you have those files in a base file?

@abezella
Copy link
Contributor Author

yes, the empty file looks like the right answer in the end (if you want a refresher on the question here was a good summary). currently fai-make-nfsroot creates base.tar withtar [...] --exclude etc/machine-id and then scripts/DEBIAN/40-misc accounts for the missing /etc/machine-id by creating an empty file and then running $ROOTCMD systemd-machine-id-setup. mk-basefile empties /etc/machine-id directly but wasn't sufficient for me w/FOCAL64.

i'll try to look further into the question of /var/lib/dbus/machine-id and its interaction with the emptied /etc/machine-id this week. as always, thank you!

@abezella
Copy link
Contributor Author

apologies for the extended delay. i have looked into this further and it appears that for an ubuntu run debootstrap will pull in dbus, whereas for debian it will not. this was found by comparing the results from debootstrap --print-debs --arch amd64 focal [...] to debootstrap --print-debs --arch amd64 bullseye [...].

as part of /var/lib/dpkg/info/dbus.postinst, dbus-uuidgen is run which creates /var/lib/dbus/machine-id. if the generated /var/lib/dbus/machine-id is included in the basefile tarball then the empty /etc/machine-id is re-populated with the /var/lib/dbus/machine-id value and all hosts built from this basefile will have the same machine id.

since /etc/machine-id is previously emptied i have removed it from this MR for mk-basefile. however, as mentioned above please note that the create_base function in bin/fai-make-nfsroot has inconsistent behavior: it does exclude /etc/machine-id instead of emptying the file.

@abezella abezella changed the title exclude /etc/machine-id and /var/lib/dbus/machine-id from basefiles t… exclude /var/lib/dbus/machine-id from basefiles t… Jul 19, 2022
@abezella
Copy link
Contributor Author

if excluding from the tarball isn't desired, an alternative is adding rm -f $xtmp/var/lib/dbus/machine-id to the cleanup-deb function

@abezella
Copy link
Contributor Author

or a more aggressive approach in scripts/DEBIAN/40-misc as suggested in https://lists.uni-koeln.de/pipermail/linux-fai/2022-July/012877.html

Flowdalic added a commit to Flowdalic/fai-config that referenced this pull request Sep 27, 2022
Unlike the other CI nodes in the trial run, the node faiproject#14 has 16
cores (instead of 8). So this allows to test the priortized wakeup of
CI nodes, which is essentially based on their core count.

Thanks to Jonas for fixing iPXE for the i4cinode14.
@Mrfai
Copy link
Contributor

Mrfai commented Oct 20, 2022

If I get it correct, the best solution is to empty the /etc/machine-id file instead of excluding it from the tar in fai-make-nfsroot as I do in mk-basefiles.

So, FAI should always create an empty /etc/machine-id but not exlcude it.
FAI should exclude var/lib/dbus/machine-id.

Is this correct?

@abezella
Copy link
Contributor Author

yes, i believe that is correct:

  • /etc/machine-id should be an empty file in the generic tarball
  • /var/lib/dbus/machine-id should be excluded from the generic tarball or removed prior to its creation

thank you!

@Mrfai
Copy link
Contributor

Mrfai commented Oct 26, 2022

I added the changes now to the master branch.

@Mrfai Mrfai closed this Oct 26, 2022
abezella pushed a commit to abezella/fai that referenced this pull request May 23, 2023
abezella pushed a commit to abezella/fai that referenced this pull request Nov 17, 2023
Flowdalic pushed a commit to Flowdalic/fai-config that referenced this pull request Mar 26, 2024
@abezella abezella deleted the basefiles-exclude-machineid branch April 30, 2024 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants