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

Fix container restart issue #4912

Merged
merged 2 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ca-container-basic-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,9 @@ jobs:
- name: Restart CA
run: |
docker restart ca
sleep 10

docker network reload --all

# wait for CA to restart
docker exec client curl \
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/ca-container-existing-certs-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,9 @@ jobs:
- name: Restart CA
run: |
docker restart ca
sleep 5
sleep 10

docker network reload --all

# wait for CA to restart
docker exec client curl \
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/kra-container-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,9 @@ jobs:
- name: Restart CA
run: |
docker restart ca
sleep 5
sleep 10

docker network reload --all

# wait for CA to restart
docker exec client curl \
Expand Down Expand Up @@ -623,7 +625,9 @@ jobs:
- name: Restart KRA
run: |
docker restart kra
sleep 5
sleep 10

docker network reload --all

# wait for KRA to restart
docker exec client curl \
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/ocsp-container-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,9 @@ jobs:
- name: Restart CA
run: |
docker restart ca
sleep 5
sleep 10

docker network reload --all

# wait for CA to restart
docker exec client curl \
Expand Down Expand Up @@ -645,7 +647,9 @@ jobs:
- name: Restart OCSP
run: |
docker restart ocsp
sleep 5
sleep 10

docker network reload --all

# wait for OCSP to restart
docker exec client curl \
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/server-container-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,9 @@ jobs:
- name: Restart server
run: |
docker restart server
sleep 5
sleep 10

docker network reload --all

# wait for server to restart
docker exec client curl \
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/tks-container-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,9 @@ jobs:
- name: Restart TKS
run: |
docker restart tks
sleep 5
sleep 10

docker network reload --all

# wait for TKS to restart
docker exec client curl \
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/tps-container-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,9 @@ jobs:
- name: Restart CA
run: |
docker restart ca
sleep 5
sleep 10

docker network reload --all

# wait for CA to restart
docker exec client curl \
Expand Down Expand Up @@ -785,7 +787,9 @@ jobs:
- name: Restart TPS
run: |
docker restart tps
sleep 5
sleep 10

docker network reload --all

# wait for TPS to restart
docker exec client curl \
Expand Down
11 changes: 8 additions & 3 deletions base/ca/bin/pki-ca-run
Original file line number Diff line number Diff line change
Expand Up @@ -361,15 +361,20 @@ rm /tmp/sslserver.crt
echo "################################################################################"
echo "INFO: Starting CA server"

trap "kill -- -$(ps -o pgid= $PID | grep -o '[0-9]*')" TERM

if [ "$UID" = "0" ]; then
# In Docker the server runs as root user but it will switch
# into pkiuser (UID=17) that belongs to the root group (GID=0).
pki-server run

pki-server run &
PID=$!
wait $PID
else
# In OpenShift/Podman the server runs as a non-root user
# (with a random UID) that belongs to the root group (GID=0).
#
# https://www.redhat.com/en/blog/jupyter-on-openshift-part-6-running-as-an-assigned-user-id
pki-server run --as-current-user
pki-server run --as-current-user &
PID=$!
wait $PID
fi
11 changes: 8 additions & 3 deletions base/kra/bin/pki-kra-run
Original file line number Diff line number Diff line change
Expand Up @@ -199,15 +199,20 @@ find /logs -type d -exec chmod +rwx -- {} +
echo "################################################################################"
echo "INFO: Starting KRA server"

trap "kill -- -$(ps -o pgid= $PID | grep -o '[0-9]*')" TERM

if [ "$UID" = "0" ]; then
# In Docker the server runs as root user but it will switch
# into pkiuser (UID=17) that belongs to the root group (GID=0).
pki-server run

pki-server run &
PID=$!
wait $PID
else
# In OpenShift/Podman the server runs as a non-root user
# (with a random UID) that belongs to the root group (GID=0).
#
# https://www.redhat.com/en/blog/jupyter-on-openshift-part-6-running-as-an-assigned-user-id
pki-server run --as-current-user
pki-server run --as-current-user &
PID=$!
wait $PID
fi
11 changes: 8 additions & 3 deletions base/ocsp/bin/pki-ocsp-run
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,20 @@ find /logs -type d -exec chmod +rwx -- {} +
echo "################################################################################"
echo "INFO: Starting OCSP server"

trap "kill -- -$(ps -o pgid= $PID | grep -o '[0-9]*')" TERM

if [ "$UID" = "0" ]; then
# In Docker the server runs as root user but it will switch
# into pkiuser (UID=17) that belongs to the root group (GID=0).
pki-server run

pki-server run &
PID=$!
wait $PID
else
# In OpenShift/Podman the server runs as a non-root user
# (with a random UID) that belongs to the root group (GID=0).
#
# https://www.redhat.com/en/blog/jupyter-on-openshift-part-6-running-as-an-assigned-user-id
pki-server run --as-current-user
pki-server run --as-current-user &
PID=$!
wait $PID
fi
10 changes: 8 additions & 2 deletions base/server/bin/pki-server-run
Original file line number Diff line number Diff line change
Expand Up @@ -228,15 +228,21 @@ rm /tmp/sslserver.crt
echo "################################################################################"
echo "INFO: Starting PKI server"

trap "kill -- -$(ps -o pgid= $PID | grep -o '[0-9]*')" TERM

if [ "$UID" = "0" ]; then
# In Docker the server runs as root user but it will switch
# into pkiuser (UID=17) that belongs to the root group (GID=0).
pki-server run
pki-server run &
PID=$!
wait $PID

else
# In OpenShift/Podman the server runs as a non-root user
# (with a random UID) that belongs to the root group (GID=0).
#
# https://www.redhat.com/en/blog/jupyter-on-openshift-part-6-running-as-an-assigned-user-id
pki-server run --as-current-user
pki-server run --as-current-user &
PID=$!
wait $PID
fi
10 changes: 8 additions & 2 deletions base/tks/bin/pki-tks-run
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,21 @@ find /logs -type d -exec chmod +rwx -- {} +
echo "################################################################################"
echo "INFO: Starting TKS server"

trap "kill -- -$(ps -o pgid= $PID | grep -o '[0-9]*')" TERM

if [ "$UID" = "0" ]; then
# In Docker the server runs as root user but it will switch
# into pkiuser (UID=17) that belongs to the root group (GID=0).
pki-server run
pki-server run &
PID=$!
wait $PID

else
# In OpenShift/Podman the server runs as a non-root user
# (with a random UID) that belongs to the root group (GID=0).
#
# https://www.redhat.com/en/blog/jupyter-on-openshift-part-6-running-as-an-assigned-user-id
pki-server run --as-current-user
pki-server run --as-current-user &
PID=$!
wait $PID
fi
10 changes: 8 additions & 2 deletions base/tps/bin/pki-tps-run
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,21 @@ find /logs -type d -exec chmod +rwx -- {} +
echo "################################################################################"
echo "INFO: Starting TPS server"

trap "kill -- -$(ps -o pgid= $PID | grep -o '[0-9]*')" TERM

if [ "$UID" = "0" ]; then
# In Docker the server runs as root user but it will switch
# into pkiuser (UID=17) that belongs to the root group (GID=0).
pki-server run
pki-server run &
PID=$!
wait $PID

else
# In OpenShift/Podman the server runs as a non-root user
# (with a random UID) that belongs to the root group (GID=0).
#
# https://www.redhat.com/en/blog/jupyter-on-openshift-part-6-running-as-an-assigned-user-id
pki-server run --as-current-user
pki-server run --as-current-user &
PID=$!
wait $PID
fi
Loading