Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uses "exec" so bash process gets replaced instead of retained #624

Merged
merged 1 commit into from Jan 10, 2018

Conversation

mhrivnak
Copy link
Member

@mhrivnak mhrivnak commented Jan 9, 2018

Describe what this PR does and why we need it:
Previously, a bash process would stay running all the time, and the broker
would be a child process of it. It is a best practice when building containers
to use "exec" to avoid such unneccessary parent processes.

Changes proposed in this pull request

  • use "exec" in the entrypoint script

Before this change, you can see the extra bash process sitting around as PID 1:

$ oc exec -it asb-2-7rd7b -- ps -awfux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
ansible+    20  0.0  0.0  47456  3240 ?        Rs+  19:40   0:00 ps -awfux
ansible+     1  0.0  0.0  11652  2412 ?        Ss   18:32   0:00 bash /usr/bin/entrypoint.sh
ansible+     9  0.2  0.3 283316 46148 ?        Sl   18:32   0:10 asbd -c /etc/ansible-service-broker/config.yaml

After this change, no bash to be found:

$ oc exec -it asb-2-5mhvl -- ps -awfux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
ansible+    16  0.0  0.0  47456  3228 ?        Rs+  21:06   0:00 ps -awfux
ansible+     1  0.8  0.2 322140 35408 ?        Ssl  21:05   0:00 asbd -c /etc/ansible-service-broker/config.yaml

Previously, a bash process would stay running all the time, and the broker
would be a child process of it. It is a best practice when building containers
to use "exec" to avoid such unneccessary parent processes.
@openshift-ci-robot openshift-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jan 9, 2018
@jmrodri jmrodri self-requested a review January 10, 2018 19:52
Copy link
Contributor

@jmrodri jmrodri left a comment

Choose a reason for hiding this comment

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

ACK

Copy link
Contributor

@shawn-hurley shawn-hurley left a comment

Choose a reason for hiding this comment

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

ACK

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 0555dff on mhrivnak:use-exec into ** on openshift:master**.

@shawn-hurley shawn-hurley merged commit 611221a into openshift:master Jan 10, 2018
@mhrivnak mhrivnak deleted the use-exec branch January 10, 2018 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants