Change the way arguments are passed to scheduler in debian.

Reviewed at https://reviews.apache.org/r/42975/
diff --git a/.gitignore b/.gitignore
index 8174623..2d30051 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,4 @@
 dist/
 .vagrant
+/build-support/*.venv
+/build-support/virtualenv-*
diff --git a/build-support/virtualenv b/build-support/virtualenv
new file mode 100755
index 0000000..334653b
--- /dev/null
+++ b/build-support/virtualenv
@@ -0,0 +1,38 @@
+#!/usr/bin/env bash
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Wrapper for self-bootstrapping virtualenv
+set -ex
+VIRTUALENV_VERSION=12.1.1
+
+if which python2.7 >/dev/null; then
+  PY=`which python2.7`
+else
+  echo 'No python2.7 interpreter found on the path.  Python will not work!' 1>&2
+  exit 1
+fi
+
+echo "Using $PY" >&2
+
+HERE=$(cd `dirname "${BASH_SOURCE[0]}"` && pwd)
+if ! [ -f "$HERE/virtualenv-$VIRTUALENV_VERSION/BOOTSTRAPPED" ]; then
+  pushd "$HERE"
+  curl -O https://pypi.python.org/packages/source/v/virtualenv/virtualenv-$VIRTUALENV_VERSION.tar.gz
+  tar zxvf virtualenv-$VIRTUALENV_VERSION.tar.gz
+  # TODO(ksweeney): Checksum
+  touch virtualenv-$VIRTUALENV_VERSION/BOOTSTRAPPED  # 2PC
+  popd
+fi
+
+exec "$PY" "$HERE/virtualenv-$VIRTUALENV_VERSION/virtualenv.py" "$@"
diff --git a/rbt b/rbt
new file mode 100755
index 0000000..5b94e53
--- /dev/null
+++ b/rbt
@@ -0,0 +1,31 @@
+#!/usr/bin/env bash
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Wrapper script for self-bootstrapping rbt.
+set -e
+
+HERE=$(cd `dirname "${BASH_SOURCE[0]}"` && pwd)
+RBTOOLS_VERSION=0.7.5
+if ! [ -f "$HERE/build-support/rbt.venv/BOOTSTRAPPED" ] || \
+    [ x`cat "$HERE/build-support/rbt.venv/BOOTSTRAPPED"` != x$RBTOOLS_VERSION ]; then
+
+  echo Bootstrapping rbtools @ $RBTOOLS_VERSION
+  rm -fr "$HERE/build-support/rbt.venv"
+  "$HERE/build-support/virtualenv" "$HERE/build-support/rbt.venv"
+  source "$HERE/build-support/rbt.venv/bin/activate"
+  python -m pip install --use-wheel "RBTools==$RBTOOLS_VERSION"
+  echo $RBTOOLS_VERSION > "$HERE/build-support/rbt.venv/BOOTSTRAPPED"
+fi
+source "$HERE/build-support/rbt.venv/bin/activate"
+exec rbt "$@"
diff --git a/specs/debian/aurora-scheduler.init b/specs/debian/aurora-scheduler.init
index b280c75..2516383 100755
--- a/specs/debian/aurora-scheduler.init
+++ b/specs/debian/aurora-scheduler.init
@@ -49,34 +49,33 @@
 
 [ -r /etc/default/aurora-scheduler ] && . /etc/default/aurora-scheduler
 
-ARGS="-cluster_name=$CLUSTER_NAME
-  -http_port=$HTTP_PORT
-  -native_log_quorum_size=$QUORUM_SIZE
-  -zk_endpoints=$ZK_ENDPOINTS
-  -mesos_master_address=$MESOS_MASTER
-  -serverset_path=$ZK_SERVERSET_PATH
-  -native_log_zk_group_path=$ZK_LOGDB_PATH
-  -native_log_file_path=$LOGDB_FILE_PATH
-  -backup_dir=$BACKUP_DIR
-  -thermos_executor_path=$THERMOS_EXECUTOR_PATH
-  -thermos_executor_resources=$THERMOS_EXECUTOR_RESOURCES
-  -thermos_executor_flags=$THERMOS_EXECUTOR_FLAGS
-  -allowed_container_types=$ALLOWED_CONTAINER_TYPES
-  $EXTRA_SCHEDULER_ARGS"
-
 export JAVA_OPTS GLOG_v LIBPROCESS_PORT LIBPROCESS_IP
 
 case "$1" in
   start)
     log_daemon_msg "Starting $DESC $NAME with $ARGS"
     start-stop-daemon --start \
-                      --quiet \
-                      --oknodo \
-                      --pidfile $PIDFILE \
-                      --background \
-                      --make-pidfile \
-                      --no-close \
-                      --exec $DAEMON -- $ARGS
+      --quiet \
+      --oknodo \
+      --pidfile $PIDFILE \
+      --background \
+      --make-pidfile \
+      --no-close \
+      --exec $DAEMON -- \
+        -cluster_name="$CLUSTER_NAME" \
+        -http_port="$HTTP_PORT" \
+        -native_log_quorum_size="$QUORUM_SIZE" \
+        -zk_endpoints="$ZK_ENDPOINTS" \
+        -mesos_master_address="$MESOS_MASTER" \
+        -serverset_path="$ZK_SERVERSET_PATH" \
+        -native_log_zk_group_path="$ZK_LOGDB_PATH" \
+        -native_log_file_path="$LOGDB_FILE_PATH" \
+        -backup_dir="$BACKUP_DIR" \
+        -thermos_executor_path="$THERMOS_EXECUTOR_PATH" \
+        -thermos_executor_resources="$THERMOS_EXECUTOR_RESOURCES" \
+        -thermos_executor_flags="$THERMOS_EXECUTOR_FLAGS" \
+        -allowed_container_types="$ALLOWED_CONTAINER_TYPES" \
+        $EXTRA_SCHEDULER_ARGS
     log_end_msg $?
     ;;
   stop)