-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support dual stack network, IP v4 and v6
- Loading branch information
Showing
8 changed files
with
160 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/sh | ||
# only processes a single environment as the placeholder is not preserved | ||
|
||
source $JBOSS_HOME/bin/launch/logging.sh | ||
|
||
function prepareEnv() { | ||
unset SERVER_USE_IPV6 | ||
} | ||
|
||
function configure() { | ||
configure_ip | ||
} | ||
|
||
function configureEnv() { | ||
configure | ||
} | ||
|
||
function configure_ip() { | ||
SERVER_IP_ADDR= | ||
get_host_ip_address "SERVER_IP_ADDR" | ||
export SERVER_IP_ADDR | ||
SERVER_BIND_ALL_ADDR=$(get_bind_all_address) | ||
export SERVER_BIND_ALL_ADDR | ||
SERVER_LOOPBACK_ADDRESS=$(get_loopback_address) | ||
export SERVER_LOOPBACK_ADDRESS | ||
log_info "Server IP address $SERVER_IP_ADDR, bindAll adress $SERVER_BIND_ALL_ADDR" | ||
if [ "xxx$SERVER_USE_IPV6" == "xxxtrue" ]; then | ||
JAVA_OPTS_APPEND="-Djava.net.preferIPv4Stack=false -Djava.net.preferIPv6Addresses=true $JAVA_OPTS_APPEND" | ||
export JAVA_OPTS_APPEND | ||
cat << EOF >> "${CLI_SCRIPT_FILE}" | ||
if (outcome == success && result != undefined) of /interface=bindall:read-resource | ||
/interface=bindall:write-attribute(name=inet-address,value="$SERVER_BIND_ALL_ADDR") | ||
end-if | ||
EOF | ||
fi | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
SCRIPT_DIR=$(dirname $0) | ||
ADDED_DIR=${SCRIPT_DIR}/added | ||
|
||
mkdir -p ${JBOSS_HOME}/bin/launch/ | ||
cp -p ${ADDED_DIR}/ip.sh ${JBOSS_HOME}/bin/launch/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
schema_version: 1 | ||
name: jboss.container.wildfly.launch.ip-address | ||
version: '1.0' | ||
description: Configure ip address. | ||
execute: | ||
- script: configure.sh | ||
user: '185' | ||
envs: | ||
- name: "SERVER_USE_IPV6" | ||
description: By default IP v4 is used. Set this env variable to true to enable IP v6. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters