Newbie question: reported systemd version inside a container

15 views
Skip to first unread message

Mark Petrovic

unread,
Jul 18, 2017, 1:29:31 PM7/18/17
to rkt-dev
I am learning how to build rkt from source.  I have chosen to also build systemd from source with --with-stage1-flavors=src, and having specified v234 as the systemd version, and pointing to the same-named tag in the systemd git repository.  My build host is running systemd v231.  Having built the stage1 from systemd source, I install the stage1 image into the image store and start a container with rkt run with --stage1-name referring to the new from-source stage1 image.

When I start a container thusly, with the rkt run --debug flag, I see rkt announce that it is using systemd v234 in the container (at least I think that's what the announcement means, late in the console output).  But when I enter the container and execute 'systemctl --version', systemd v215 is reported.  I expected to have systemd v234 reported.

I must be missing something obvious.  Would someone be kind enough to clue me in?

Thank you.

Euan Kemp

unread,
Jul 18, 2017, 1:45:48 PM7/18/17
to rkt...@googlegroups.com
On 07/18/2017 10:29 AM, Mark Petrovic wrote:
> When I start a container thusly, with the rkt run --debug flag, I see
> rkt announce that it is using systemd v234 in the container (at least I
> think that's what the announcement means, late in the console output).

This output is from the stage1; effectively it's from `systemd-nspawn
--boot`.
This information should be correct for your given stage1 image.

> But when I enter the container and execute 'systemctl --version',
> systemd v215 is reported. I expected to have systemd v234 reported.

This is output from the stage2; the application image.
Presumably whatever application image you specified (maybe
docker://debian?) includes a copy of systemctl as well.

I'll refer to the execution chain diagram here:
https://github.com/rkt/rkt/blob/v1.27.0/Documentation/devel/architecture.md#execution-chain

The boxes labeled "stage2" are full mount namespaces. In those mount
namespaces, you can't interact with the binaries in the stage1.
Whatever binaries/libraries are used there are unrelated to either the
host or stage1.


Hopefully that clarifies what you're seeing,
Euan

signature.asc

Mark Petrovic

unread,
Jul 18, 2017, 2:16:22 PM7/18/17
to rkt-dev
Oh, my; yes, it should have been obvious to me.  This is now clear to me.  Your last paragraph is particularly illuminating.

Many thanks.
Reply all
Reply to author
Forward
0 new messages