Message ID | 23841300f5a85914d9c0fc19b24df485ba861efa.1725049576.git.yann.morin.1998@free.fr |
---|---|
State | Accepted |
Headers | show |
Series | system: extend the list of init systems (branch yem/init-choice) | expand |
Hi Yann, On Fri, Aug 30, 2024 at 10:26 PM Yann E. MORIN <yann.morin.1998@free.fr> wrote: > > Tini is a special-purpose init system, aimed at containers. > > Add it to the choice of init systems. > > tini does not require much, so we re-use the default "none" skeleton. > > Note that tini is no longer selectable on its own, which it used to be. > This change will require that people using tini be careful when > upgrading, though, but that will be very easily caught, as the > containers would no longer start at all. > > We could ad a comment stating why, but no other init system has such a > comment, so adding one for tini alone would be weird, so we don't add > one. > > Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> > Cc: Dario Binacchi <dario.binacchi@amarulasolutions.com> > Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> > --- > package/tini/Config.in | 1 + > system/Config.in | 16 ++++++++++++++++ > 2 files changed, 17 insertions(+) > > diff --git a/package/tini/Config.in b/package/tini/Config.in > index 719e1e1f22..bca8ad8e96 100644 > --- a/package/tini/Config.in > +++ b/package/tini/Config.in > @@ -1,6 +1,7 @@ > config BR2_PACKAGE_TINI > bool "tini" > depends on BR2_USE_MMU # fork() > + depends on BR2_INIT_TINI > help > tini is a simple but valid init binary to > act as PID 1 for containers. > diff --git a/system/Config.in b/system/Config.in > index 18cc39ad94..d7d59db47d 100644 > --- a/system/Config.in > +++ b/system/Config.in > @@ -149,6 +149,22 @@ comment "systemd highly recommends Linux >= 4.15" > > comment "Special purpose (read help)" > > +config BR2_INIT_TINI > + bool "tini" > + depends on BR2_USE_MMU # tini > + select BR2_PACKAGE_TINI > + select BR2_PACKAGE_SKELETON_INIT_NONE if BR2_ROOTFS_SKELETON_DEFAULT > + help > + Tini - A tiny but valid init for containers > + > + Tini is the simplest init you could think of. > + > + All Tini does is spawn a single child (Tini is meant to be run > + in a container), and wait for it to exit all the while reaping > + zombies and performing signal forwarding. > + > + https://github.com/krallin/tini > + > config BR2_INIT_NONE > bool "Custom (none)" > select BR2_PACKAGE_SKELETON_INIT_NONE if BR2_ROOTFS_SKELETON_DEFAULT > -- > 2.46.0 > Reviewed-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> Regards, Dario
Hi Yann, At 2024-09-14 17:04:26, "Dario Binacchi" <dario.binacchi@amarulasolutions.com> wrote: >Hi Yann, > >On Fri, Aug 30, 2024 at 10:26 PM Yann E. MORIN <yann.morin.1998@free.fr> wrote: >> >> Tini is a special-purpose init system, aimed at containers. >> >> Add it to the choice of init systems. >> >> tini does not require much, so we re-use the default "none" skeleton. >> >> Note that tini is no longer selectable on its own, which it used to be. >> This change will require that people using tini be careful when >> upgrading, though, but that will be very easily caught, as the >> containers would no longer start at all. >> >> We could ad a comment stating why, but no other init system has such a >> comment, so adding one for tini alone would be weird, so we don't add >> one. >> >> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> >> Cc: Dario Binacchi <dario.binacchi@amarulasolutions.com> >> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> >> --- >> package/tini/Config.in | 1 + >> system/Config.in | 16 ++++++++++++++++ >> 2 files changed, 17 insertions(+) >> >> diff --git a/package/tini/Config.in b/package/tini/Config.in >> index 719e1e1f22..bca8ad8e96 100644 >> --- a/package/tini/Config.in >> +++ b/package/tini/Config.in >> @@ -1,6 +1,7 @@ >> config BR2_PACKAGE_TINI >> bool "tini" >> depends on BR2_USE_MMU # fork() >> + depends on BR2_INIT_TINI >> help >> tini is a simple but valid init binary to >> act as PID 1 for containers. >> diff --git a/system/Config.in b/system/Config.in >> index 18cc39ad94..d7d59db47d 100644 >> --- a/system/Config.in >> +++ b/system/Config.in >> @@ -149,6 +149,22 @@ comment "systemd highly recommends Linux >= 4.15" >> >> comment "Special purpose (read help)" >> >> +config BR2_INIT_TINI >> + bool "tini" >> + depends on BR2_USE_MMU # tini >> + select BR2_PACKAGE_TINI >> + select BR2_PACKAGE_SKELETON_INIT_NONE if BR2_ROOTFS_SKELETON_DEFAULT >> + help >> + Tini - A tiny but valid init for containers >> + >> + Tini is the simplest init you could think of. >> + >> + All Tini does is spawn a single child (Tini is meant to be run >> + in a container), and wait for it to exit all the while reaping >> + zombies and performing signal forwarding. >> + >> + https://github.com/krallin/tini >> + >> config BR2_INIT_NONE >> bool "Custom (none)" >> select BR2_PACKAGE_SKELETON_INIT_NONE if BR2_ROOTFS_SKELETON_DEFAULT >> -- >> 2.46.0 >> > >Reviewed-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> > >Regards, >Dario > I think this is completely **wrong**. People usually do not put docker-init (such as tini/catatonit) in container images, but in the host system, and use it by `docker run --init`. Only inits such as supervisor/s6 will be placed in container images. Regards, TIAN Yuanhao
TIAN Yuanhao, All, On 2024-09-18 16:02 +0800, TIAN Yuanhao spake thusly: > At 2024-09-14 17:04:26, "Dario Binacchi" <dario.binacchi@amarulasolutions.com> wrote: > >On Fri, Aug 30, 2024 at 10:26 PM Yann E. MORIN <yann.morin.1998@free.fr> wrote: > >> Tini is a special-purpose init system, aimed at containers. > >> Add it to the choice of init systems. [--SNIP--] > I think this is completely **wrong**. > People usually do not put docker-init (such as tini/catatonit) in > container images, but in the host system, and use it by > `docker run --init`. The container world does not revolve only around docker; there are other solutions. We do have a situation where the container runtime will expect us to actually provide our own PID-1 that is a proper reaper. In that situation, we do need to have tini in the container and running as the entrypoint. Note that tini also works if it is not PID-1; in that case, it uses the subreaper feature (since kernel 3.4, ages ago now!). You mention catatonit. I was not aware about it, and neither that it was packaged in Buildroot, but then it might make sense to also add that to the list, now. If one still wants to delegate the PID-1 reaper to a docker-provided tini (or alternative), then it is still possible to select the "Custom (none)" entry in the choice. Regards, Yann E. MORIN.
diff --git a/package/tini/Config.in b/package/tini/Config.in index 719e1e1f22..bca8ad8e96 100644 --- a/package/tini/Config.in +++ b/package/tini/Config.in @@ -1,6 +1,7 @@ config BR2_PACKAGE_TINI bool "tini" depends on BR2_USE_MMU # fork() + depends on BR2_INIT_TINI help tini is a simple but valid init binary to act as PID 1 for containers. diff --git a/system/Config.in b/system/Config.in index 18cc39ad94..d7d59db47d 100644 --- a/system/Config.in +++ b/system/Config.in @@ -149,6 +149,22 @@ comment "systemd highly recommends Linux >= 4.15" comment "Special purpose (read help)" +config BR2_INIT_TINI + bool "tini" + depends on BR2_USE_MMU # tini + select BR2_PACKAGE_TINI + select BR2_PACKAGE_SKELETON_INIT_NONE if BR2_ROOTFS_SKELETON_DEFAULT + help + Tini - A tiny but valid init for containers + + Tini is the simplest init you could think of. + + All Tini does is spawn a single child (Tini is meant to be run + in a container), and wait for it to exit all the while reaping + zombies and performing signal forwarding. + + https://github.com/krallin/tini + config BR2_INIT_NONE bool "Custom (none)" select BR2_PACKAGE_SKELETON_INIT_NONE if BR2_ROOTFS_SKELETON_DEFAULT
Tini is a special-purpose init system, aimed at containers. Add it to the choice of init systems. tini does not require much, so we re-use the default "none" skeleton. Note that tini is no longer selectable on its own, which it used to be. This change will require that people using tini be careful when upgrading, though, but that will be very easily caught, as the containers would no longer start at all. We could ad a comment stating why, but no other init system has such a comment, so adding one for tini alone would be weird, so we don't add one. Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> Cc: Dario Binacchi <dario.binacchi@amarulasolutions.com> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> --- package/tini/Config.in | 1 + system/Config.in | 16 ++++++++++++++++ 2 files changed, 17 insertions(+)