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

Ruben Kerkhof ruben at rubenkerkhof.com
Tue Apr 29 13:18:38 PDT 2014


On Mon, Apr 28, 2014 at 9:04 PM, Ruben Kerkhof <ruben at rubenkerkhof.com> wrote:
> 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

I think I know what's wrong.
systemd-nspawn --uuid takes a 36-character uuid string.
It is converted to sd_128_t arg_uuid in nspawn.c:parse_args
and then placed in the environment of pid 1 as 32-character string:
if (asprintf((char**)(envp + n_env++), "container_uuid="
SD_ID128_FORMAT_STR, SD_ID128_FORMAT_VAL(arg_uuid)) < 0)

machine-id-setup.c:generate however expects a 36-character string in
the environment.

Kind regards,

Ruben


More information about the systemd-devel mailing list