Use dumb-init with --single-child

We would probably like to forward signals only to the direct child
which in turn takes care its children and not to all worker child
processes.

(cherry picked from commit 6258a920fd)

This change also includes a cherry pick of a fix for bifrost:

Clear ENTRYPOINT configuration for Bifrost

Bifrost was broken by the recent kolla change [1] to use an ENTRYPOINT
for dumb-init. The container failed to start because dumb-init was
trying to run /sbin/init, which expects to be pid 1.

[1] Id91ebb8b0ecc43946845de386350af0536dd661f

(cherry picked from commit b06d8387f5)

Change-Id: Id91ebb8b0ecc43946845de386350af0536dd661f
Depends-On: https://review.openstack.org/621871/
Closes-Bug: #1808326
Related-Bug: #1799642
Related-Bug: #1799642
This commit is contained in:
Rabi Mishra 2018-10-24 11:24:07 +05:30 committed by Mark Goddard
parent 3bc14c84b1
commit 1dacd1944e
2 changed files with 7 additions and 4 deletions

View File

@ -429,8 +429,7 @@ COPY curlrc /root/.curlrc
{% if base_arch == 'x86_64' %}
RUN curl -sSL https://github.com/Yelp/dumb-init/releases/download/v1.1.3/dumb-init_1.1.3_amd64 -o /usr/local/bin/dumb-init \
&& chmod +x /usr/local/bin/dumb-init \
&& sed -i 's|#!|#!/usr/local/bin/dumb-init |' /usr/local/bin/kolla_start
&& chmod +x /usr/local/bin/dumb-init
{% else %}
@ -440,10 +439,12 @@ RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \
&& python get-pip.py \
&& rm get-pip.py \
&& pip --no-cache-dir install --prefix='/usr/local' dumb-init==1.1.3 \
&& chmod +x /usr/local/bin/dumb-init \
&& sed -i 's|#!|#!/usr/local/bin/dumb-init |' /usr/local/bin/kolla_start
&& chmod +x /usr/local/bin/dumb-init
{% endif %}
ENTRYPOINT ["dumb-init", "--single-child", "--"]
{% endblock %}
RUN touch /usr/local/bin/kolla_extend_start \

View File

@ -54,6 +54,8 @@ RUN /usr/sbin/update-rc.d -f ondemand remove; \
{{ macros.install_packages(bifrost_deploy_packages | customizable("packages")) }}
# Clear any customisation by Kolla to entrypoint & command
ENTRYPOINT []
CMD [ "/sbin/init" ]
{% block bifrost_deploy_footer %}{% endblock %}