[systemd-devel] Host and machine ids are equal (4c93d957bcf44b289c3e4edb5bd5c355): refusing to link journals

Ruben Kerkhof ruben at rubenkerkhof.com
Mon Apr 28 12:04:37 PDT 2014


On Mon, Apr 28, 2014 at 6:12 PM, Lennart Poettering
<lennart at poettering.net> wrote:
> Oh yuck, this looks like a bug in systemd.
>
> Currently if /etc/machine-id is missing we will try to initialize it
> from the UUID that KVM maintaines for each machine. However, this is a
> bad idea if we are actually running inside a container already...
>
> I fixed this now in 984233ceb6dfeecd8b43864795a660a200e4ac78 (I
> hope). Please verify.

Thanks. Systemd now generates a random id instead of using the uuid
from my kvm vm:

Detected virtualization 'systemd-nspawn'.

Detected architecture 'x86-64'.


Welcome to Arch Linux!


Initializing machine ID from random generator.

Passing in a uuid doesn't seem to work though:

[ruben at vm ~]$ sudo rm testcontainer/etc/machine-id
[ruben at vm ~]$ uuid=$(uuidgen); echo $uuid
d9611cff-f011-4c7c-8c76-2fe4154f7ed3
[ruben at vm ~]$ sudo systemd-nspawn -bD ~/testcontainer --uuid=$uuid

Detected virtualization 'systemd-nspawn'.

Detected architecture 'x86-64'.


Welcome to Arch Linux!


Initializing machine ID from random generator.

I would have expected that to be 'Initializing machine ID from container UUID.'
container_uuid is set in the environment:

[root at testcontainer ~]# tr '\0' '\n' < /proc/1/environ | grep container

container=systemd-nspawn
container_uuid=d9611cfff0114c7c8c762fe4154f7ed3

Any ideas?

Kind regards,

Ruben


More information about the systemd-devel mailing list