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

empty /etc/machine-id on centos #37

Closed
hmalphettes opened this issue Mar 7, 2016 · 3 comments
Closed

empty /etc/machine-id on centos #37

hmalphettes opened this issue Mar 7, 2016 · 3 comments

Comments

@hmalphettes
Copy link
Contributor

Hi! Many thanks for maintaining those base images.
I noticed that the file /etc/machine-id was set to 2f59308c746c49e29cc2b9997ddb22da
Would it be possible to reset it to an empty file in the base image to make sure that systemd will reinitialise it?

Here is my current workaround:

    marcus.vm.provision :shell, name: 'set fleet_public_ip',
      inline: <<eos
      # The box we are using has unfortunately a hardcoded machine-id.
      # We must not have multiple machines in the cluster with the same machine-id.
      if [ "2f59308c746c49e29cc2b9997ddb22da" = "$(cat /etc/machine-id)" ]; then
        echo "Must reset the /etc/machine-id and reboot. Please run 'vagrant up marcus1 --provision' again"
        echo "" > /etc/machine-id
        sudo poweroff
      fi
eos

Thanks!

@annawake
Copy link
Contributor

annawake commented Apr 4, 2016

Added to cleanup routine

@annawake annawake closed this as completed Apr 4, 2016
@hmalphettes
Copy link
Contributor Author

Much appreciated @annawake !

@bertvv
Copy link
Contributor

bertvv commented Nov 24, 2016

The machine-id file is now removed in the cleanup script. This will prevent it from being generated by systemd at boot time, causing systemd-journald and systemd-tmpfiles-setup* services to fail.

When /etc/machine-id is an empty file, systemd will generate the machine-id automatically. So, it's better to use the code suggested by @hmalphettes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants