-
Notifications
You must be signed in to change notification settings - Fork 10
/
startnexus
executable file
·33 lines (26 loc) · 981 Bytes
/
startnexus
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
export JAVA_HOME=/usr/lib/jvm/java
export CONTEXT_PATH=/
export MAX_HEAP=768m
export MIN_HEAP=256m
export JAVA_OPTS="-server -Djava.net.preferIPv4Stack=true"
export LAUNCHER_CONF="./conf/jetty.xml ./conf/jetty-requestlog.xml"
export USER_ID=$(id -u)
export GROUP_ID=$(id -g)
export LD_PRELOAD=libnss_wrapper.so
export NSS_WRAPPER_PASSWD=/tmp/passwd
export NSS_WRAPPER_GROUP=/etc/group
#We only need to copy the default configuration if no configuration has been externally provided.
if [ ! -f /sonatype-work/conf/nexus.xml ]; then
mkdir -p /sonatype-work/conf/
cp /usr/local/share/nexus.xml /sonatype-work/conf/nexus.xml
fi
if [ ! -f /tmp/passwd ]; then
envsubst < /usr/local/share/passwd.template > /tmp/passwd
fi
${JAVA_HOME}/bin/java \
-Dnexus-work=${SONATYPE_WORK} -Dnexus-webapp-context-path=${CONTEXT_PATH} \
-Xms${MIN_HEAP} -Xmx${MAX_HEAP} \
-cp 'conf/:lib/*' \
${JAVA_OPTS} \
org.sonatype.nexus.bootstrap.Launcher ${LAUNCHER_CONF}