[
https://issues.apache.org/jira/browse/DIRSERVER-2175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15726816#comment-15726816
]
Stan R edited comment on DIRSERVER-2175 at 12/6/16 10:07 PM:
-------------------------------------------------------------
I've attached a sample Dockerfile for a minimal container based on alpine if
needed for build testing. Generates an image just under 190mb all-in
(os+java+apacheds). Please feel free to chop it up and use it however you see
fit.
I can't say that the patch would work on Mac OSX. I have no way to test,
unfortunately.
was (Author: stncr):
I've attached a sample Dockerfile for a minimal container based on alpine if
needed for build testing. Generates an image just under 190mb all-in
(os+java+apacheds).
I can't say that it would work on Mac OSX, but it is probably at least more
likely to than it was before. I have no way to test, unfortunately.
> apacheds.sh startup script: support for more shells
> ---------------------------------------------------
>
> Key: DIRSERVER-2175
> URL: https://issues.apache.org/jira/browse/DIRSERVER-2175
> Project: Directory ApacheDS
> Issue Type: Improvement
> Affects Versions: 2.0.0-M23
> Environment: Linux, Busybox Ash shell
> Reporter: Stan R
> Priority: Trivial
> Attachments: Dockerfile.alpine.apacheds, apacheds.sh.patch
>
>
> Attempting to start ApacheDS via the apacheds.sh startup script with a shell
> other than bash, such as busybox Ash shell, results in the following error:
> {noformat}
> $ sh apacheds.sh run
> apacheds.sh: line 113: syntax error: unexpected "(" (expecting ")")
> {noformat}
> The offending line 113 (and 1 previous) for reference:
> {noformat}
> # Build the classpath (http://stackoverflow.com/a/4729899/516433)
> CLASSPATH=$(JARS=("$ADS_HOME"/lib/*.jar); IFS=:; echo "${JARS[*]}")
> {noformat}
> Analyzing the offending line reveals that the classpath is built using a
> bash-specific syntax/feature for arrays -- functionality not found in other
> shells. Following the helpful link on line 112 to stackoverflow for further
> explanation reveals that while the manual classpath creation methodology via
> bash arrays used to be the "best" available, it is now deprecated. According
> to the stackoverflow page, building the classpath manually is no longer a
> necessity as of at least 2012; the classpath can now contain wildcards, and
> Java will kindly resolve the wildcards on its own. Further investigation of
> the classpath wildcard resolution functionality reveals that the feature has
> been present in Java 1.7 since release 1 (I downloaded the first release and
> looked at the manpage "java.1") in 2011.
> Since ApacheDS requires Java 1.7 as a prerequisite, and the wildcard
> classpath resolution functionality is present in all versions of Java 1.7 and
> up, I propose eliminating the bash-only manual classpath creation, and
> instead take advantage of the 5-year-old enhancement present in Java, so that
> other shells may be supported when executing the apacheds.sh script.
> The largest benefit to supporting shells other than bash, is for situations
> in which ApacheDS is deployed in minimalized container environments for
> security reasons, where attempts are made to reduce potential attack surface
> by removing all unnecessary features, libraries, and software. To this end,
> bash is a prime candidate for removal as a dependency (see shellshock).
> Given the above, changing line 113 to the following allows the script to be
> executed, and ApacheDS to be launched, without error in busybox's ash shell
> and bash shell (and perhaps others):
> {noformat}
> CLASSPATH="$ADS_HOME/lib/*"
> {noformat}
> I will attempt to attach a patchfile if I can.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)