nixpkgs/pkgs/servers/nosql/riak/riak-1.3.1.patch
Malcolm Matalka 992f5b8d26 Add Riak 1.3.1
This modifies how the `riak` and `riak-admin` scripts work such that one has to specify environment variables for where the data, log, and etc directories live.
2013-06-04 04:12:06 +02:00

65 lines
1.7 KiB
Diff

--- a/rel/files/riak 2013-05-22 20:45:55.613299952 +0200
+++ b/rel/files/riak 2013-06-04 03:20:47.679943612 +0200
@@ -13,33 +13,34 @@
fi
unset POSIX_SHELL # clear it so if we invoke other scripts, they run as ksh as well
+if [ -z "$RIAK_ETC_DIR" ]; then
+ echo "Must set RIAK_ETC_DIR"
+ exit 1
+fi
+
+if [ -z "$RIAK_LOG_DIR" ]; then
+ echo "Must set RIAK_LOG_DIR"
+ exit 1
+fi
+
+if [ -z "$RIAK_DATA_DIR" ]; then
+ echo "Must set RIAK_DATA_DIR"
+ exit 1
+fi
+
RUNNER_SCRIPT_DIR={{runner_script_dir}}
RUNNER_SCRIPT=${0##*/}
RUNNER_BASE_DIR={{runner_base_dir}}
-RUNNER_ETC_DIR={{runner_etc_dir}}
+RUNNER_ETC_DIR=$RIAK_ETC_DIR
RUNNER_LIB_DIR={{platform_lib_dir}}
-RUNNER_LOG_DIR={{runner_log_dir}}
+RUNNER_LOG_DIR=$RIAK_LOG_DIR
# Note the trailing slash on $PIPE_DIR/
PIPE_DIR={{pipe_dir}}
-RUNNER_USER={{runner_user}}
-PLATFORM_DATA_DIR={{platform_data_dir}}
+PLATFORM_DATA_DIR=$RIAK_DATA_DIR
SSL_DIST_CONFIG=$PLATFORM_DATA_DIR/ssl_distribution.args_file
RIAK_VERSION="git"
-WHOAMI=$(whoami)
-
-# Make sure this script is running as the appropriate user
-if ([ "$RUNNER_USER" ] && [ "x$WHOAMI" != "x$RUNNER_USER" ]); then
- type sudo > /dev/null 2>&1
- if [ $? -ne 0 ]; then
- echo "sudo doesn't appear to be installed and your EUID isn't $RUNNER_USER" 1>&2
- exit 1
- fi
- echo "Attempting to restart script through sudo -H -u $RUNNER_USER" >&2
- exec sudo -H -u $RUNNER_USER -i $RUNNER_SCRIPT_DIR/$RUNNER_SCRIPT $@
-fi
-
# Warn the user if ulimit -n is less than 4096
ULIMIT_F=`ulimit -n`
if [ "$ULIMIT_F" -lt 4096 ]; then
@@ -48,9 +49,6 @@
echo "!!!!"
fi
-# Make sure CWD is set to runner base dir
-cd $RUNNER_BASE_DIR
-
# Make sure log directory exists
mkdir -p $RUNNER_LOG_DIR