From eeb4680557c5f3c99197c65bf67a1b884db78e70 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Fri, 25 Apr 2014 18:02:06 +0100 Subject: Truncate /etc/machine-id instead of deleting it. If /etc/machine-id exists but is empty, systemd will do tricks with bind-mounts to ensure that a valid transient UUID is bind-mounted over it, which is exactly what we want for a live system. If /etc/machine-id does not exist, systemd-journald will just fail, which is undesirable. --- share/hooks/0180-remove-systemd-machine-id.hook.chroot | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'share/hooks') diff --git a/share/hooks/0180-remove-systemd-machine-id.hook.chroot b/share/hooks/0180-remove-systemd-machine-id.hook.chroot index 52ba38fd4..ed5d6bf6a 100755 --- a/share/hooks/0180-remove-systemd-machine-id.hook.chroot +++ b/share/hooks/0180-remove-systemd-machine-id.hook.chroot @@ -2,8 +2,12 @@ set -e -# Remove systemd machine id. -# -# This removes systemd machine id that cache that makes each system unique. +# Blank out systemd machine id. If it does not exist, systemd-journald +# will fail, but if it exists and is empty, systemd will automatically +# set up a new unique ID. -rm -f /etc/machine-id +if [ -e /etc/machine-id ] +then + rm -f /etc/machine-id + : > /etc/machine-id +fi -- cgit v1.2.3