From 5594d7e2a41407576fbf342907aa7b321d41fae0 Mon Sep 17 00:00:00 2001 From: Mike Bonnet Date: Tue, 30 Apr 2019 15:01:21 -0700 Subject: [PATCH] Explain what run-httpd is doing --- openshift/frontend/run-httpd | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/openshift/frontend/run-httpd b/openshift/frontend/run-httpd index b48363d8..184684a7 100755 --- a/openshift/frontend/run-httpd +++ b/openshift/frontend/run-httpd @@ -2,6 +2,14 @@ set -eu +# OpenShift containers run as a user with a random uid, which does not appear in +# /etc/passwd. httpd tries to look up the uid for the user it is running as +# (default in this case), and will exit if it cannot find that user in +# /etc/passwd. This script copies /etc/passwd to /tmp to make it writable, and +# appends an entry to /etc/passwd for the "default" user, using the current uid +# and gid. It then uses libnss_wrapper.so to redirect references from +# /etc/passwd to our modified file in /tmp, so httpd can run as "default". + export USER_ID=$(id -u) export GROUP_ID=$(id -g)