Chad has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/299164

Change subject: Minor tweaks to 2.12.2 package
......................................................................

Minor tweaks to 2.12.2 package

- Bring in all plugins, makes the install step easier (--batch works now)
- Update init script from upstream

Change-Id: I022e6890ebe0c1a4fde94390c4c4db302ef43393
---
M debian/changelog
M debian/gerrit.init
M debian/install
A plugins/commit-message-length-validator.jar
A plugins/download-commands.jar
R plugins/its-phabricator.jar
A plugins/replication.jar
A plugins/reviewnotes.jar
A plugins/singleusergroup.jar
9 files changed, 54 insertions(+), 26 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/debs/gerrit 
refs/changes/64/299164/1

diff --git a/debian/changelog b/debian/changelog
index d6fe864..62810b7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+gerrit (2.12.2-wmf.1) jessie-wikimedia; urgency=low
+
+  * Bring in all installed plugins rather than expecting the install to extract
+  * Update init file from 2.12.2 default
+
+ -- Chad Horohoe <ch...@wikimedia.org>  Fri, 15 Jul 2016 15:22:28 +0000
+
 gerrit (2.12.2) jessie-wikimedia; urgency=low
 
   * Updating to Gerrit 2.12.2
diff --git a/debian/gerrit.init b/debian/gerrit.init
index d43c322..7e6f943 100755
--- a/debian/gerrit.init
+++ b/debian/gerrit.init
@@ -47,7 +47,7 @@
 
 usage() {
     me=`basename "$0"`
-    echo >&2 "Usage: $me {start|stop|restart|check|status|run|supervise} [-d 
site]"
+    echo >&2 "Usage: $me 
{start|stop|restart|check|status|run|supervise|threads} [-d site]"
     exit 1
 }
 
@@ -61,6 +61,13 @@
   PID=`cat $1`
   ps -p $PID >/dev/null 2>/dev/null || return 1
   return 0
+}
+
+thread_dump() {
+  test -f $1 || return 1
+  PID=`cat $1`
+  $JSTACK $PID || return 1
+  return 0;
 }
 
 get_config() {
@@ -119,7 +126,7 @@
 ##################################################
 # See if there's a default configuration file
 ##################################################
-if test -f /etc/default/gerritcodereview ; then 
+if test -f /etc/default/gerritcodereview ; then
   . /etc/default/gerritcodereview
 fi
 
@@ -150,20 +157,9 @@
 # Try to determine GERRIT_SITE if not set
 ##################################################
 if test -z "$GERRIT_SITE" ; then
-  GERRIT_SITE_1=`dirname "$0"`
-
-  ##################################################
-  # As last resort assume we started the script from
-  # the bin directory of the Gerrit installation
-  ##################################################
-  if [ "$GERRIT_SITE_1" = "." ]; then
-      GERRIT_SITE_1=`pwd`
-  fi
-
-  GERRIT_SITE_1=`dirname "$GERRIT_SITE_1"`
-
-  if test -f "${GERRIT_SITE_1}/${GERRIT_INSTALL_TRACE_FILE}" ; then 
-    GERRIT_SITE=${GERRIT_SITE_1} 
+  GERRIT_SITE_1=`dirname "$0"`/..
+  if test -f "${GERRIT_SITE_1}/${GERRIT_INSTALL_TRACE_FILE}" ; then
+    GERRIT_SITE=${GERRIT_SITE_1}
   fi
 fi
 
@@ -171,10 +167,11 @@
 # No GERRIT_SITE yet? We're out of luck!
 ##################################################
 if test -z "$GERRIT_SITE" ; then
-    echo >&2 "** ERROR: GERRIT_SITE not set" 
+    echo >&2 "** ERROR: GERRIT_SITE not set"
     exit 1
 fi
 
+INITIAL_DIR=`pwd`
 if cd "$GERRIT_SITE" ; then
   GERRIT_SITE=`pwd`
 else
@@ -227,7 +224,7 @@
     "
     for N in java jdk jre ; do
       for L in $JAVA_LOCATIONS ; do
-        test -d "$L" || continue 
+        test -d "$L" || continue
         find $L -name "$N" ! -type d | grep -v threads | while read J ; do
           test -x "$J" || continue
           VERSION=`eval "$J" -version 2>&1`
@@ -264,8 +261,12 @@
 if test -z "$JAVA" ; then
   echo >&2 "Cannot find a JRE or JDK. Please set JAVA_HOME or"
   echo >&2 "container.javaHome in $GERRIT_SITE/etc/gerrit.config"
-  echo >&2 "to a >=1.6 JRE"
+  echo >&2 "to a >=1.7 JRE"
   exit 1
+fi
+
+if test -z "$JSTACK"; then
+  JSTACK="$JAVA_HOME/bin/jstack"
 fi
 
 #####################################################
@@ -336,6 +337,11 @@
 if test "`get_config --bool container.slave`" = "true" ; then
   RUN_ARGS="$RUN_ARGS --slave"
 fi
+DAEMON_OPTS=`get_config --get-all container.daemonOpt`
+if test -n "$DAEMON_OPTS" ; then
+  RUN_ARGS="$RUN_ARGS $DAEMON_OPTS"
+fi
+
 if test -n "$JAVA_OPTIONS" ; then
   RUN_ARGS="$JAVA_OPTIONS $RUN_ARGS"
 fi
@@ -363,7 +369,7 @@
   start)
     printf '%s' "Starting Gerrit Code Review: "
 
-    if test 1 = "$NO_START" ; then 
+    if test 1 = "$NO_START" ; then
       echo "Not starting gerrit - NO_START=1 in /etc/default/gerritcodereview"
       exit 0
     fi
@@ -388,7 +394,7 @@
           echo >&2 "fatal: start-stop-daemon failed"
           rc=1
         fi
-        exit $rc 
+        exit $rc
       fi
     else
       if test -f "$GERRIT_PID" ; then
@@ -400,7 +406,7 @@
         fi
       fi
 
-      if test $UID = 0 -a -n "$GERRIT_USER" ; then 
+      if test $UID = 0 -a -n "$GERRIT_USER" ; then
         touch "$GERRIT_PID"
         chown $GERRIT_USER "$GERRIT_PID"
         su - $GERRIT_USER -s /bin/sh -c "
@@ -449,7 +455,7 @@
 
     if test 1 = "$START_STOP_DAEMON" && type start-stop-daemon >/dev/null 2>&1
     then
-      start-stop-daemon -K -p "$GERRIT_PID" -s HUP 
+      start-stop-daemon -K -p "$GERRIT_PID" -s HUP
       sleep 1
       if running "$GERRIT_PID" ; then
         sleep 3
@@ -481,8 +487,13 @@
     if test -f "$GERRIT_SH" ; then
       : OK
     else
-      echo >&2 "** ERROR: Cannot locate gerrit.sh"
-      exit 1
+      GERRIT_SH="$INITIAL_DIR/$GERRIT_SH"
+      if test -f "$GERRIT_SH" ; then
+        : OK
+      else
+        echo >&2 "** ERROR: Cannot locate gerrit.sh"
+        exit 1
+      fi
     fi
     $GERRIT_SH stop $*
     sleep 5
@@ -536,6 +547,16 @@
     exit 3
   ;;
 
+  threads)
+    if running "$GERRIT_PID" ; then
+      thread_dump "$GERRIT_PID"
+      exit 0
+    else
+      echo "Gerrit not running?"
+    fi
+    exit 3
+  ;;
+
   *)
     usage
   ;;
diff --git a/debian/install b/debian/install
index 0b82c04..ee3db6e 100644
--- a/debian/install
+++ b/debian/install
@@ -1,2 +1,2 @@
 gerrit.war /var/lib/gerrit2
-its-phabricator.jar /var/lib/gerrit2/review_site/plugins
+plugins /var/lib/gerrit2/review_site/
diff --git a/plugins/commit-message-length-validator.jar 
b/plugins/commit-message-length-validator.jar
new file mode 100644
index 0000000..ec2ee7b
--- /dev/null
+++ b/plugins/commit-message-length-validator.jar
Binary files differ
diff --git a/plugins/download-commands.jar b/plugins/download-commands.jar
new file mode 100644
index 0000000..32d7004
--- /dev/null
+++ b/plugins/download-commands.jar
Binary files differ
diff --git a/its-phabricator.jar b/plugins/its-phabricator.jar
similarity index 100%
rename from its-phabricator.jar
rename to plugins/its-phabricator.jar
Binary files differ
diff --git a/plugins/replication.jar b/plugins/replication.jar
new file mode 100644
index 0000000..63601fc
--- /dev/null
+++ b/plugins/replication.jar
Binary files differ
diff --git a/plugins/reviewnotes.jar b/plugins/reviewnotes.jar
new file mode 100644
index 0000000..74d2349
--- /dev/null
+++ b/plugins/reviewnotes.jar
Binary files differ
diff --git a/plugins/singleusergroup.jar b/plugins/singleusergroup.jar
new file mode 100644
index 0000000..6b0bffc
--- /dev/null
+++ b/plugins/singleusergroup.jar
Binary files differ

-- 
To view, visit https://gerrit.wikimedia.org/r/299164
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I022e6890ebe0c1a4fde94390c4c4db302ef43393
Gerrit-PatchSet: 1
Gerrit-Project: operations/debs/gerrit
Gerrit-Branch: master
Gerrit-Owner: Chad <ch...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to