• Anton Midyukov's avatar
    init: clear machine id · ebe22ccd
    Anton Midyukov authored
    systemd create new uniq machine-id on first boot.
    so that during mass deployment of containers, virtual machines or
    live there are no identical machine-ids on computers in the same network.
    Reported by obirvalger@
    ebe22ccd
99-clear-machine-id 220 Bytes
#!/bin/sh -eu

etc_machine_id=/etc/machine-id
dbus_machine_id=/var/lib/dbus/machine-id

[ -f "$etc_machine_id" ] || exit 0

rm -f "$etc_machine_id" "$dbus_machine_id"
touch "$etc_machine_id"
chmod 0444 "$etc_machine_id"