Skip to content

Conversation

afbjorklund
Copy link
Member

@afbjorklund afbjorklund commented Aug 22, 2025

The original container image has some optional metadata in the ENTRYPOINT and STOPSIGNAL fields, that could be needed later...

But these are not exported in the generic rootfs, by default.

Make it possible to pass these at runtime, for instance to select between OpenRC and systemd - or SIGTERM and systemd.

Some drivers include their config in the rootfs, like wsl.conf.

Required by: (currently hardcoded)


Example for systemd

ENTRYPOINT [ "/usr/local/bin/entrypoint", "/sbin/init" ]

Where /sbin/init was symlinked over to /lib/systemd/systemd

STOPSIGNAL SIGRTMIN+3

The defaults are to run either with the VM's init, or with --init

And to use acpi or similar for VMs, or SIGTERM for containers

The original container image has some optional metadata in the
ENTRYPOINT and STOPSIGNAL fields, that could be needed later...

But these are not exported in the generic rootfs, by default.

Make it possible to pass these at runtime, for instance to
select between OpenRC and systemd - or SIGTERM and systemd.

Some drivers include their config in the rootfs, like wsl.conf.

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ptobably these should be incubated as VMOpts entries.

vmOpts:
  container:
    entrypoint: foo

@afbjorklund
Copy link
Member Author

afbjorklund commented Aug 22, 2025

Ptobably these should be incubated as VMOpts entries.

They are specific to the image, depending on their "init"
Some images use OpenRC, while some use systemd

Currently it is only implemented by wsl.conf, for WSL2 :

https://learn.microsoft.com/en-us/windows/wsl/wsl-config

/etc/wsl.conf, while inside a WSL distribution

[boot]
systemd=true

But I would rather not have to modify each rootfs image.
(or peek inside the tarball, to see what it actually contains)

@jandubois
Copy link
Member

I don't understand why the filenames need to be configurable; they can be hardwired, like all the other files in the instance directory.

And I also don't understand why this needs to be configurable. Why don't we always write the entrypoint and stopsignal to the corresponding files? If the driver doesn't need them, then it could ignore them.

@afbjorklund
Copy link
Member Author

afbjorklund commented Aug 23, 2025

I don't understand why the filenames need to be configurable

The filenames are hardcoded, it is the content that is configurable.

Similar to the already existing (underdocumented) kernel.cmdline file

The driver would just pass to --entrypoint (and maybe --stop-signal)

Copy link
Member

@jandubois jandubois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM

@jandubois
Copy link
Member

jandubois commented Aug 23, 2025

The filenames are hardcoded, it is the content that is configurable.

Thanks, I misread the diff.

@AkihiroSuda I agree with @afbjorklund that these settings should be defined with the image, next to the kernel setting.

I.e. they would be included in the template://_image/DISTRO.yaml templates and should not be separated out into the derived templates.

@afbjorklund afbjorklund marked this pull request as draft August 27, 2025 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants