Skip to content

Commit

Permalink
Fix #578 Update reference directory for server
Browse files Browse the repository at this point in the history
Move it to the server folder instead of the kit root. This allows
moving out server from a kit and use that as the set of files to copy
on different hosts.
  • Loading branch information
ljacomet committed May 30, 2017
1 parent d975cf3 commit 6dc36d0
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions common/src/main/java/com/tc/config/Directories.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,17 @@ public class Directories {
/**
* Relative location for server lib directory under Terracotta installation directory
*/
public static final String SERVER_LIB_DIR = "server/lib";
public static final String SERVER_LIB_DIR = "lib";

/**
* Relative location for server plugin api directory under Terracotta installation directory
*/
public static final String SERVER_PLUGIN_API_DIR = "server/plugins/api";
public static final String SERVER_PLUGIN_API_DIR = "plugins/api";

/**
* Relative location for server plugin lib directory under Terracotta installation directory
*/
public static final String SERVER_PLUGIN_LIB_DIR = "server/plugins/lib";
public static final String SERVER_PLUGIN_LIB_DIR = "plugins/lib";

/**
* Get installation root directory.
Expand Down
22 changes: 11 additions & 11 deletions terracotta-kit/src/assemble/server/bin/start-tc-server.bat
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ exit /b 0
:start
setlocal enabledelayedexpansion enableextensions

set TC_INSTALL_DIR=%~d0%~p0..\..
set TC_INSTALL_DIR="%TC_INSTALL_DIR:"=%"
set PLUGIN_LIB_DIR=%TC_INSTALL_DIR%\server\plugins\lib
set PLUGIN_API_DIR=%TC_INSTALL_DIR%\server\plugins\api
set TC_SERVER_DIR=%~d0%~p0..\..
set TC_SERVER_DIR="%TC_SERVER_DIR:"=%"
set PLUGIN_LIB_DIR=%TC_SERVER_DIR%\plugins\lib
set PLUGIN_API_DIR=%TC_SERVER_DIR%\plugins\api

if exist %TC_INSTALL_DIR%\server\bin\setenv.bat (
call %TC_INSTALL_DIR%\server\bin\setenv.bat
if exist %TC_SERVER_DIR%\bin\setenv.bat (
call %TC_SERVER_DIR%\bin\setenv.bat
)

if not defined JAVA_HOME (
Expand Down Expand Up @@ -76,24 +76,24 @@ set PLUGIN_CLASSPATH="%PLUGIN_CLASSPATH:"=%"

REM Adding SLF4j libraries to the classpath of the server to
REM support services that may use SLF4j for logging
if exist %TC_INSTALL_DIR%\server\lib (
for %%K in (%TC_INSTALL_DIR%\server\lib\slf4j*.jar) do (
if exist %TC_SERVER_DIR%\lib (
for %%K in (%TC_SERVER_DIR%\lib\slf4j*.jar) do (
set PLUGIN_CLASSPATH=!PLUGIN_CLASSPATH!;"%%K"
)
) else (
echo %TC_INSTALL_DIR%\server\lib does not exist!
echo %TC_SERVER_DIR%\lib does not exist!
)

REM todo do i still need to enable nullglob?
REM $ENV{NULLGLOB} = 0;

set CLASSPATH=%TC_INSTALL_DIR%\server\lib\tc.jar;%PLUGIN_CLASSPATH%
set CLASSPATH=%TC_SERVER_DIR%\lib\tc.jar;%PLUGIN_CLASSPATH%
set OPTS=%SERVER_OPT% -Xms256m -Xmx2g -XX:+HeapDumpOnOutOfMemoryError
set OPTS=%OPTS% -Dcom.sun.management.jmxremote
rem rmi.dgc.server.gcInterval is set as year to avoid system gc in case authentication is enabled
rem users may change it accordingly
set OPTS=%OPTS% -Dsun.rmi.dgc.server.gcInterval=31536000000
set OPTS=%OPTS% -Dtc.install-root=%TC_INSTALL_DIR%
set OPTS=%OPTS% -Dtc.install-root=%TC_SERVER_DIR%
set JAVA_OPTS=%OPTS% %JAVA_OPTS%


Expand Down
12 changes: 6 additions & 6 deletions terracotta-kit/src/assemble/server/bin/start-tc-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ esac


THIS_DIR=`dirname $0`
TC_INSTALL_DIR=`cd $THIS_DIR;pwd`/../..
PLUGIN_LIB_DIR="$TC_INSTALL_DIR/server/plugins/lib"
PLUGIN_API_DIR="$TC_INSTALL_DIR/server/plugins/api"
TC_SERVER_DIR=`cd $THIS_DIR;pwd`/..
PLUGIN_LIB_DIR="$TC_SERVER_DIR/plugins/lib"
PLUGIN_API_DIR="$TC_SERVER_DIR/plugins/api"

if test \! -d "${JAVA_HOME}"; then
echo "$0: the JAVA_HOME environment variable is not defined correctly"
Expand Down Expand Up @@ -65,7 +65,7 @@ function setPluginClasspath {
done
# Adding SLF4j libraries to the classpath of the server to
# support services that may use SLF4j for logging
for jarFile in "${TC_INSTALL_DIR}"/server/lib/slf4j*.jar
for jarFile in "${TC_SERVER_DIR}"/lib/slf4j*.jar
do
PLUGIN_CLASSPATH=${PLUGIN_CLASSPATH}:${jarFile}
done
Expand All @@ -87,10 +87,10 @@ do
# the max heap is <= 2G, hence we set the heap size to a bit more than 2GB
${JAVA_COMMAND} -Xms256m -Xmx2049m -XX:+HeapDumpOnOutOfMemoryError \
-Dcom.sun.management.jmxremote \
-Dtc.install-root="${TC_INSTALL_DIR}" \
-Dtc.install-root="${TC_SERVER_DIR}" \
-Dsun.rmi.dgc.server.gcInterval=31536000000\
${JAVA_OPTS} \
-cp "${TC_INSTALL_DIR}/server/lib/tc.jar:${PLUGIN_CLASSPATH}" \
-cp "${TC_SERVER_DIR}/lib/tc.jar:${PLUGIN_CLASSPATH}" \
com.tc.server.TCServerMain "$@"
exitValue=$?
start=false;
Expand Down

0 comments on commit 6dc36d0

Please sign in to comment.