Skip to content

Commit c2ebebe

Browse files
committed
[OPENJDK-493] Don't install NSS Wrapper for OpenJDK17 containers
Introduce a new module jboss.container.util.nss-wrapper to encapsulate the nss_wrapper config introduced with OPENJDK-312. Move (almost) all nss_wrapper configuration into the new module. (The configure_passwd function in run-java.sh remains, however, it's benign. To remove this we need to extend run-java to support pluggable functionality.) Add the new module as an explicit dependency to the images which use it, that is, all of the full-fat images. No changes made to the OpenJDK 17 descriptor, which means it should omit the nss_wrapper configuration entirely. Signed-off-by: Jonathan Dowland <[email protected]>
1 parent 8f68f4b commit c2ebebe

File tree

8 files changed

+38
-15
lines changed

8 files changed

+38
-15
lines changed

modules/run/module.yaml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,24 +48,12 @@ envs:
4848
- name: JAVA_ARGS
4949
description: Arguments passed to the `java` application.
5050

51-
- name: LD_PRELOAD
52-
value: libnss_wrapper.so
53-
- name: NSS_WRAPPER_PASSWD
54-
value: /home/jboss/passwd
55-
- name: NSS_WRAPPER_GROUP
56-
value: /etc/group
57-
5851
execute:
5952
- script: configure.sh
6053
- script: backward_compatibility.sh
6154

6255
modules:
6356
install:
64-
- name: jboss.container.user
6557
- name: jboss.container.java.jvm.bash
6658
- name: jboss.container.util.logging.bash
6759
- name: jboss.container.openjdk.jdk
68-
69-
packages:
70-
install:
71-
- nss_wrapper

modules/user/configure.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
set -e
33

44
# Create a user and group used to launch processes
5-
# We use the ID 185 fot the group as well as for the user.
5+
# We use the ID 185 for the group as well as for the user.
66
# This ID is registered static ID for the JBoss EAP product
77
# on RHEL which makes it safe to use.
88
groupadd -r jboss -g 185 && useradd -u 185 -r -g root -G jboss -m -d /home/jboss -s /sbin/nologin -c "JBoss user" jboss
9-
cp /etc/passwd /home/jboss/passwd
10-
chmod ug+rwX /home/jboss /home/jboss/passwd

modules/util/nss-wrapper/configure.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
# set up a copy of the passwd file which nss_wrapper will use.
5+
cp /etc/passwd /home/jboss/passwd
6+
chmod ug+rwX /home/jboss /home/jboss/passwd

modules/util/nss-wrapper/module.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
schema_version: 1
2+
name: jboss.container.util.nss-wrapper
3+
version: '1.0'
4+
description: ^
5+
Installs and configures NSS wrapper.
6+
See <https://issues.redhat.com/browse/OPENJDK-312>.
7+
8+
envs:
9+
- name: LD_PRELOAD
10+
value: libnss_wrapper.so
11+
- name: NSS_WRAPPER_PASSWD
12+
value: /home/jboss/passwd
13+
- name: NSS_WRAPPER_GROUP
14+
value: /etc/group
15+
16+
execute:
17+
- script: configure.sh
18+
19+
packages:
20+
install:
21+
- nss_wrapper
22+
23+
# We don't explicitly depend on jboss.container.user but that module must
24+
# be evaluated before this one.
25+
modules:
26+
install:
27+
- name: jboss.container.user

openjdk-11-rhel7.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ modules:
4444
version: "7"
4545
- name: jboss.container.jolokia
4646
version: "7"
47+
- name: jboss.container.util.nss-wrapper
4748
- name: jboss.container.java.s2i.bash
4849
- name: jboss.container.maven
4950
version: "7.0.3.6"

openjdk18-openshift.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ modules:
4545
version: "7"
4646
- name: jboss.container.jolokia
4747
version: "7"
48+
- name: jboss.container.util.nss-wrapper
4849
- name: jboss.container.java.s2i.bash
4950
- name: jboss.container.maven
5051
version: "7.0.3.6"

ubi8-openjdk-11.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ modules:
4646
- name: jboss.container.jolokia
4747
- name: jboss.container.maven
4848
version: "8.2.3.6"
49+
- name: jboss.container.util.nss-wrapper
4950
- name: jboss.container.java.s2i.bash
5051
- name: jboss.container.java.singleton-jdk
5152

ubi8-openjdk-8.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ modules:
4646
- name: jboss.container.jolokia
4747
- name: jboss.container.maven
4848
version: "8.2.3.6.8"
49+
- name: jboss.container.util.nss-wrapper
4950
- name: jboss.container.java.s2i.bash
5051

5152
help:

0 commit comments

Comments
 (0)