summary refs log tree commit diff
path: root/pkgs/servers/nosql/riak/riak-admin-1.3.1.patch
blob: 9c87a6329943f5d443e6fa9c25e4fba49f72d0d9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
--- a/rel/files/riak-admin	2013-05-22 20:45:55.613299952 +0200
+++ b/rel/files/riak-admin	2013-06-04 03:30:00.101604175 +0200
@@ -11,31 +11,31 @@
 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
 RUNNER_USER={{runner_user}}
 
-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
-
-# Make sure CWD is set to runner base dir
-cd $RUNNER_BASE_DIR
-
 # Extract the target node name from node.args
 NAME_ARG=`egrep "^ *-s?name" $RUNNER_ETC_DIR/vm.args`
 if [ -z "$NAME_ARG" ]; then