Unpack JARs for running servers in $site_path/tmp
Instead of unpacking a running server into ~/.gerritcodereview/tmp only use that location for commands like init where there is no active site. From gerrit.sh always use $site_path/tmp for the JARs to isolate servers that run on the same host under the same UNIX user account. Change-Id: I688490ffbbf70312767bb766dc7ccbea52401ad1
This commit is contained in:
@@ -423,6 +423,11 @@ public final class GerritLauncher {
|
||||
}
|
||||
|
||||
private static File tmproot() {
|
||||
File tmp;
|
||||
String gerritTemp = System.getenv("GERRIT_TMP");
|
||||
if (gerritTemp != null && gerritTemp.length() > 0) {
|
||||
tmp = new File(gerritTemp);
|
||||
} else {
|
||||
// Try to find the user's home directory. If we can't find it
|
||||
// return null so the JVM's default temporary directory is used
|
||||
// instead. This is probably /tmp or /var/tmp.
|
||||
@@ -452,7 +457,8 @@ public final class GerritLauncher {
|
||||
|
||||
// Use $HOME/.gerritcodereview/tmp for our temporary file area.
|
||||
//
|
||||
final File tmp = new File(new File(home, ".gerritcodereview"), "tmp");
|
||||
tmp = new File(new File(home, ".gerritcodereview"), "tmp");
|
||||
}
|
||||
if (!tmp.exists() && !tmp.mkdirs()) {
|
||||
System.err.println("warning: cannot create " + tmp.getAbsolutePath());
|
||||
System.err.println("warning: using system temporary directory instead");
|
||||
|
||||
@@ -176,6 +176,8 @@ test -r "$GERRIT_CONFIG" || {
|
||||
|
||||
GERRIT_PID="$GERRIT_SITE/logs/gerrit.pid"
|
||||
GERRIT_RUN="$GERRIT_SITE/logs/gerrit.run"
|
||||
GERRIT_TMP="$GERRIT_SITE/tmp"
|
||||
export GERRIT_TMP
|
||||
|
||||
##################################################
|
||||
# Check for JAVA_HOME
|
||||
@@ -492,6 +494,7 @@ case "$ACTION" in
|
||||
echo " GERRIT_SITE = $GERRIT_SITE"
|
||||
echo " GERRIT_CONFIG = $GERRIT_CONFIG"
|
||||
echo " GERRIT_PID = $GERRIT_PID"
|
||||
echo " GERRIT_TMP = $GERRIT_TMP"
|
||||
echo " GERRIT_WAR = $GERRIT_WAR"
|
||||
echo " GERRIT_FDS = $GERRIT_FDS"
|
||||
echo " GERRIT_USER = $GERRIT_USER"
|
||||
|
||||
Reference in New Issue
Block a user