diff --git a/Makefile b/Makefile index 6969c2061..601a7811b 100644 --- a/Makefile +++ b/Makefile @@ -76,15 +76,15 @@ test : testclean eunit test-deps rel: compile @$(REBAR) as rel release # freebsd tar won't write to stdout, so - @tar -c -f rel.tar --exclude '*/.git/*' -C _build/rel/rel riak && tar -x -f rel.tar -C rel && rm rel.tar + @tar -c -f rel.tar --exclude-vcs -C _build/rel/rel riak && tar -x -f rel.tar -C rel && rm rel.tar rel-rpm: compile @$(REBAR) as rpm release - @tar --exclude='*/.git/*' -c -C _build/rpm/rel riak | tar -x -C rel + @tar --exclude-vcs -c -C _build/rpm/rel riak | tar -x -C rel rel-deb: compile @$(REBAR) as deb release - @tar --exclude='*/.git/*' -c -C _build/deb/rel riak | tar -x -C rel + @tar --exclude=vcs -c -C _build/deb/rel riak | tar -x -C rel rel-osx: compile @$(REBAR) as osx release diff --git a/rel/files/riak b/rel/files/riak index 76343aaf1..28cfaa031 100755 --- a/rel/files/riak +++ b/rel/files/riak @@ -2,8 +2,8 @@ RUNNER_GEN_DIR={{platform_gen_dir}} RELX_RIAK={{platform_bin_dir}}/riak -PID_DIR={{pid_dir}} -PIPE_DIR={{pipe_dir}}/ # terminating / (relx treats it as a prefix) +export PID_DIR={{pid_dir}} +export PIPE_DIR={{pipe_dir}}/ # terminating / (relx treats it as a prefix) mkdir -p $PID_DIR $PIPE_DIR chown riak:riak $PID_DIR $PIPE_DIR @@ -53,12 +53,12 @@ function maybe_su { case "$1" in start) - maybe_su $RELX_RIAK $* -pa {{runner_patch_dir}} \ + maybe_su $RELX_RIAK $* -pa {{platform_patch_dir}} \ && write_pid_file test -r $PID_DIR/riak.pid && exit 0 ;; console|foreground) - maybe_su $RELX_RIAK $* -pa {{runner_patch_dir}} + maybe_su $RELX_RIAK $* -pa {{platform_patch_dir}} ;; stop) maybe_su $RELX_RIAK $* \ @@ -68,6 +68,10 @@ case "$1" in shift maybe_su `which riak-admin` $* ;; + chkconfig) + shift + maybe_su `which riak-chkconfig` $* + ;; repl) shift maybe_su `which riak-repl` $* diff --git a/rel/files/riak-admin b/rel/files/riak-admin index fc9efb54b..0ad7450e2 100755 --- a/rel/files/riak-admin +++ b/rel/files/riak-admin @@ -5,14 +5,35 @@ # Identify the script name SCRIPT="riak-admin" -RPC_HOP="{{platform_bin_dir}}/riak rpc" +PLATFORM_BASE_DIR={{platform_base_dir}} +PLATFORM_BASE_DIR=${PLATFORM_BASE_DIR:-$(cd $(dirname "$0")/.. && pwd -P)} + +PLATFORM_BIN_DIR={{platform_bin_dir}} +if [ "$PLATFORM_BIN_DIR" = "${PLATFORM_BIN_DIR#/}" ]; then + PLATFORM_BIN_DIR=$PLATFORM_BASE_DIR/$PLATFORM_BIN_DIR +fi + +RPC_HOP="${PLATFORM_BIN_DIR}/riak rpc" +RPCt_HOP="${PLATFORM_BIN_DIR}/riak rpcterms" + +PLATFORM_ETC_DIR={{platform_etc_dir}} +if [ "$PLATFORM_ETC_DIR" = "${PLATFORM_ETC_DIR#/}" ]; then + PLATFORM_ETC_DIR=$PLATFORM_BASE_DIR/$PLATFORM_ETC_DIR +fi + +PLATFORM_PATCH_DIR={{platform_patch_dir}} +if [ "$PLATFORM_PATCH_DIR" = "${PLATFORM_PATCH_DIR#/}" ]; then + PLATFORM_PATCH_DIR=$PLATFORM_BASE_DIR/$PLATFORM_PATCH_DIR +fi + +ERTS_VER=$(cd ${PLATFORM_BASE_DIR} && ls -d erts-*) +ERTS_PATH="${PLATFORM_BASE_DIR}/$ERTS_VER/bin" +COOKIE=`egrep '^[ \t]*distributed_cookie[ \t]*=[ \t]*' $PLATFORM_ETC_DIR/riak.conf 2> /dev/null | cut -d = -f 2 | tr -d ' '` -ERTS_PATH="{{runner_base_dir}}/`(cd {{runner_base_dir}} && ls -d erts-*)`/bin" -COOKIE=`egrep '^[ \t]*distributed_cookie[ \t]*=[ \t]*' {{platform_etc_dir}}/riak.conf 2> /dev/null | cut -d = -f 2 | tr -d ' '` NODE={{node}} HOST=${NODE#*@} -BOOT_FILE="{{runner_base_dir}}/releases/{{rel_vsn}}/start_clean" +BOOT_FILE="${PLATFORM_BASE_DIR}/releases/{{release_version}}/start_clean" usage() { echo "Usage: $SCRIPT { cluster | join | leave | backup | restore | test | " @@ -804,7 +825,7 @@ case "$1" in echo "Lists the services available on the node. See also: wait-for-service" exit 1 fi - $RPC_HOPterms riak_core_node_watcher services '' + $RPCt_HOP riak_core_node_watcher services '' ;; wait[_-]for[_-]service) @@ -818,7 +839,7 @@ case "$1" in while (true); do # Make sure riak_core_node_watcher is up and running locally before trying to query it # to avoid ugly (but harmless) error messages - NODEWATCHER=`$RPC_HOPterms erlang whereis "'riak_core_node_watcher'."` + NODEWATCHER=`$RPCt_HOP erlang whereis "'riak_core_node_watcher'."` if [ "$NODEWATCHER" = "undefined" ]; then echo "$SVC is not up: node watcher is not running" continue @@ -827,9 +848,9 @@ case "$1" in # Get the list of services that are available on the requested node # If no node is specified, get the list of services from the local node if [ "X$TARGETNODE" = "X" ]; then - SERVICES=`$RPC_HOPterms riak_core_node_watcher services ''` + SERVICES=`$RPCt_HOP riak_core_node_watcher services ''` else - SERVICES=`$RPC_HOPterms riak_core_node_watcher services "'${TARGETNODE}'."` + SERVICES=`$RPCt_HOP riak_core_node_watcher services "'${TARGETNODE}'."` fi echo "$SERVICES" | grep "[[,]$SVC[],]" > /dev/null 2>&1 if [ "X$?" = "X0" ]; then @@ -870,7 +891,7 @@ case "$1" in OLDNODE=$1 NEWNODE=$2 $ERTS_PATH/erl -noshell \ - -pa {{runner_patch_dir}} \ + -pa {{platform_patch_dir}} \ -boot $BOOT_FILE \ $CONFIG_ARGS \ -eval "riak_kv_console:$ACTION(['$OLDNODE', '$NEWNODE'])" \ @@ -891,7 +912,7 @@ case "$1" in FILENAME=$3 $ERTS_PATH/erl -noshell -name riak_kv_backup@$HOST -setcookie $COOKIE \ - -pa {{runner_patch_dir}} \ + -pa {{platform_patch_dir}} \ -boot $BOOT_FILE \ -eval "riak_kv_backup:$ACTION('$NODE', \"$FILENAME\")" -s init stop ;; @@ -911,12 +932,12 @@ case "$1" in TYPE=$4 $ERTS_PATH/erl -noshell -name riak_kv_backup@$HOST -setcookie $COOKIE \ - -pa {{runner_patch_dir}} \ + -pa {{platform_patch_dir}} \ -boot $BOOT_FILE \ -eval "riak_kv_backup:$ACTION('$NODE', \"$FILENAME\", \"$TYPE\")" -s init stop ;; - test) + 'test') # Make sure the local node IS running shift @@ -924,7 +945,7 @@ case "$1" in # Parse out the node name to pass to the client $ERTS_PATH/erl -noshell -name riak_test@$HOST -setcookie $COOKIE \ - -pa {{runner_patch_dir}} \ + -pa {{platform_patch_dir}} \ -boot $BOOT_FILE \ -eval "case catch(riak:client_test(\"$NODE\")) of \ ok -> init:stop(); \ @@ -959,7 +980,7 @@ case "$1" in RAND=$(($(($$ % 1000)) + 1)) # Using np_etop instead of riak_etop to follow node_package convention $ERTS_PATH/erl -noshell -noinput \ - -pa {{runner_base_dir}} \ + -pa {{platform_patch_dir}} \ -boot $BOOT_FILE \ -hidden -name np_etop$RAND@$HOST -setcookie $COOKIE \ -s etop -s erlang halt -output text \ diff --git a/rel/files/riak-chkconfig b/rel/files/riak-chkconfig old mode 100644 new mode 100755 index 9d521460e..43617b5fe --- a/rel/files/riak-chkconfig +++ b/rel/files/riak-chkconfig @@ -2,11 +2,32 @@ # -*- tab-width:4;indent-tabs-mode:nil -*- # ex: ts=4 sw=4 et -## cf_config defines the config arguments needed -. bin/cf_config +PLATFORM_BASE_DIR={{platform_base_dir}} +PLATFORM_BASE_DIR=${PLATFORM_BASE_DIR:-$(cd $(dirname "$0")/.. && pwd -P)} +RPC_HOP="${PLATFORM_BASE_DIR}/bin/riak rpc" +RPCt_HOP="${PLATFORM_BASE_DIR}/bin/riak rpcterms" -## "vm.args = $VMARGS_PATH" -## "app.config = $CONFIG_PATH" +ERTS_VER=$(cd ${PLATFORM_BASE_DIR} && ls -d erts-*) +ERTS_PATH="${PLATFORM_BASE_DIR}/$ERTS_VER/bin" + +PLATFORM_ETC_DIR={{platform_etc_dir}} +if [ "$PLATFORM_ETC_DIR" = "${PLATFORM_ETC_DIR#/}" ]; then + PLATFORM_ETC_DIR=$PLATFORM_BASE_DIR/$PLATFORM_ETC_DIR +fi + +COOKIE=`egrep '^[ \t]*distributed_cookie[ \t]*=[ \t]*' "$PLATFORM_ETC_DIR"/riak.conf 2> /dev/null | cut -d = -f 2 | tr -d ' '` +NODE={{node}} +HOST=${NODE#*@} + +BOOT_FILE="${PLATFORM_BASE_DIR}/releases/{{release_version}}/start_clean" + +PLATFORM_GEN_DIR={{platform_gen_dir}} +if [ "$PLATFORM_GEN_DIR" = "${PLATFORM_GEN_DIR#/}" ]; then + PLATFORM_GEN_DIR=$PLATFORM_BASE_DIR/$PLATFORM_GEN_DIR +fi + +CONFIG_PATH=`ls -1r ${PLATFORM_GEN_DIR}/generated.conf/app.*.config | head -n1` +VMARGS_PATH=`ls -1r ${PLATFORM_GEN_DIR}/generated.conf/vm.*.args | head -n1` CODE=" try {ok, _} = file:consult(\"$CONFIG_PATH\"), @@ -18,6 +39,11 @@ CODE=" try halt(1) end." -$BINDIR/erl -noshell -boot start_clean -eval "$CODE" +$ERTS_PATH/erl -noshell -noinput \ + -pa $PLATFORM_PATCH_DIR \ + -boot $BOOT_FILE \ + -hidden -name riak_chkconfig$RAND@$HOST -setcookie $COOKIE \ + -node $NODE -tracing off \ + -eval "$CODE" -echo $CUTTLE_CONF +echo $CONFIG_PATH $VMARGS_PATH diff --git a/rel/files/riak-debug b/rel/files/riak-debug index 8b0ffb975..a70ee1f06 100755 --- a/rel/files/riak-debug +++ b/rel/files/riak-debug @@ -134,12 +134,43 @@ exit ### Set up variables ### +is_relative() { + if [ "${1#/}" = "$1" ]; then + return 0 + else + return 1 + fi +} + # These paths may be overridden with environment variables. -RUNNER_BASE_DIR={{runner_base_dir}} -riak_base_dir={{runner_base_dir}} -riak_bin_dir={{runner_script_dir}} -riak_etc_dir={{runner_etc_dir}} -riak_sbin_dir=/usr/sbin +RIAK_PATH="${RIAK_PATH:-$(cd $(dirname "$0")/.. && pwd -P)}" +PLATFORM_BASE_DIR={{platform_base_dir}} +riak_base_dir=$PLATFORM_BASE_DIR +if is_relative "{{platform_bin_dir}}"; then + riak_bin_dir="$PLATFORM_BASE_DIR/{{platform_bin_dir}}" +else + riak_bin_dir="{{platform_bin_dir}}" +fi +if is_relative "{{platform_etc_dir}}"; then + riak_etc_dir="$PLATFORM_BASE_DIR/{{platform_etc_dir}}" +else + riak_etc_dir="{{platform_etc_dir}}" +fi +if is_relative "{{platform_log_dir}}"; then + riak_log_dir="$PLATFORM_BASE_DIR/{{platform_log_dir}}" +else + riak_log_dir="{{platform_log_dir}}" +fi +if is_relative "{{platform_lib_dir}}"; then + riak_lib_dir="$PLATFORM_BASE_DIR/{{platform_lib_dir}}" +else + riak_lib_dir="{{platform_lib_dir}}" +fi +if is_relative "{{platform_gen_dir}}"; then + riak_gen_dir="$PLATFORM_BASE_DIR/{{platform_gen_dir}}" +else + riak_gen_dir="{{platform_gen_dir}}" +fi get_cfgs=0 get_ssl_certs=0 @@ -151,13 +182,6 @@ get_syscmds=0 get_extracmds=0 verbose_output=0 -## Use riak config generate to set $riak_app_config and -## $riak_vm_args -gen_result=`"$riak_bin_dir"/riak chkconfig | grep -v "OK" | cut -d' ' -f 2,4` -riak_app_config=`echo $gen_result | cut -d' ' -f 1` -generated_config_dir=`dirname "$riak_app_config"` -riak_vm_args=`echo $gen_result | cut -d' ' -f 2` - ### ### Parse options ### @@ -272,6 +296,20 @@ if [ 0 -ne $(( $get_cfgs + $get_logs + $get_patches + $get_riakcmds + $get_yzcmd fi . "$epath_file" + ## Use riak config generate to set $riak_app_config and + ## $riak_vm_args + gen_result=`"$riak_bin_dir"/riak-chkconfig | grep -v "OK"` + riak_app_config=`echo $gen_result | cut -d' ' -f 1` + generated_config_dir=`dirname "$riak_app_config"` + riak_vm_args=`echo $gen_result | cut -d' ' -f 2` + + # Make a flat, easily searchable version of the app.config settings + riak_epaths=`make_app_epaths "${riak_app_config}"` + # run it now, before any other `riak cmd` (each such call invokes + # cuttlefish, which generates a new (and totally identical) app and + # vm.args config file in platform_gen_dir, eventually rotating the one + # we have just found) + # Allow overriding riak_base_dir and riak_etc_dir from the environment if [ -n "$RIAK_BASE_DIR" ]; then riak_base_dir="$RIAK_BASE_DIR" @@ -305,6 +343,7 @@ if [ 0 -ne $(( $get_cfgs + $get_logs + $get_patches + $get_riakcmds + $get_yzcmd fi + if [ -f "${riak_vm_args}" ]; then node_name="`egrep '^\-s?name' "${riak_vm_args}" 2>/dev/null | cut -d ' ' -f 2`" fi @@ -471,26 +510,23 @@ if [ 1 -eq $get_riakcmds ]; then # commands on Riak<=1.2.0 and should not be executed in a loop against all # nodes in a cluster. - dump riak_ping "$riak_sbin_dir"/riak ping - dump riak_version "$riak_sbin_dir"/riak versions - dump riak_member_status "$riak_sbin_dir"/riak admin member-status - dump riak_ring_status "$riak_sbin_dir"/riak admin ring-status - dump riak_status "$riak_sbin_dir"/riak admin status - dump riak_transfers "$riak_sbin_dir"/riak admin transfers - dump riak_diag "$riak_sbin_dir"/riak admin diag - dump riak_repl_status "$riak_sbin_dir"/riak repl status - dump riak_repl_connections "$riak_sbin_dir"/riak repl connections - dump riak_repl_clusterstats "$riak_sbin_dir"/riak repl clusterstats - dump riak_repl_modes "$riak_sbin_dir"/riak repl modes - - # Make a flat, easily searchable version of the app.config settings - riak_epaths=`make_app_epaths "${riak_app_config}"` + dump riak_ping "$riak_bin_dir"/riak ping + dump riak_version "$riak_bin_dir"/riak versions + dump riak_member_status "$riak_bin_dir"/riak-admin member-status + dump riak_ring_status "$riak_bin_dir"/riak-admin ring-status + dump riak_status "$riak_bin_dir"/riak-admin status + dump riak_transfers "$riak_bin_dir"/riak-admin transfers + dump riak_diag "$riak_bin_dir"/riak-admin diag + dump riak_repl_status "$riak_bin_dir"/riak-repl status + dump riak_repl_connections "$riak_bin_dir"/riak-repl connections + dump riak_repl_clusterstats "$riak_bin_dir"/riak-repl clusterstats + dump riak_repl_modes "$riak_bin_dir"/riak-repl modes # If Yokozuna is not installed, $yz_test will be null. yz_test="`epath 'yokozuna root_dir' "$riak_epaths" | sed -e 's/^\"//' -e 's/\".*$//'`" # Only execute the search aae_statis command if $yz_test is not null. if [ -n "$yz_test" ]; then - dump riak_search_aae_status "$riak_sbin_dir"/riak admin search aae-status + dump riak_search_aae_status "$riak_bin_dir"/riak-admin search aae-status fi # Get one http listener (epath might output a newline-separated list). @@ -533,9 +569,6 @@ fi ### if [ 1 -eq $get_yzcmds ]; then - # if not already made, make a flat, searchable version of the app.config - [ -z "$riak_epaths" ] && riak_epaths=`make_app_epaths "${riak_app_config}"` - yz_dir="`epath 'yokozuna root_dir' "$riak_epaths" | sed -e 's/^\"//' -e 's/\".*$//'`" # If Yokozuna is not installed, $yz_dir will be null and cause errors. # Only execute the Yokozuna commands if $yz_dir is not null. @@ -600,7 +633,7 @@ fi if [ 1 -eq $get_extracmds ]; then mkdir_or_die "${start_dir}"/"${debug_dir}"/commands/.info cd "${start_dir}"/"${debug_dir}"/commands - dump riak_vnode_status "$riak_sbin_dir"/riak admin vnode-status + dump riak_vnode_status "$riak_bin_dir"/riak-admin vnode-status fi ### @@ -611,9 +644,6 @@ if [ 1 -eq $get_logs ]; then mkdir_or_die "${start_dir}"/"${debug_dir}"/logs/.info cd "${start_dir}"/"${debug_dir}"/logs - # if not already made, make a flat, searchable version of the app.config - [ -z "$riak_epaths" ] && riak_epaths=`make_app_epaths "${riak_app_config}"` - log_dir="`epath 'riak_core platform_log_dir' "$riak_epaths" | sed -e 's/^\"//' -e 's/\".*$//'`" if [ '/' != `echo "$log_dir" | cut -c1` ]; then # relative path. prepend base dir @@ -753,9 +783,9 @@ if [ 1 -eq $get_logs ]; then elif [ 'riak_kv_multi_backend' = "$backend" ] || [ 'riak_cs_kv_multi_backend' = "$backend" ] ; then for b in `epath 'riak_kv multi_backend' "$riak_epaths" | cut -d ' ' -f 1 | uniq`; do - backend="`epath "riak_kv multi_backend $b" "$riak_epaths" | cut -d ' ' -f 1 | uniq`" + backend="`epath "$b" "$riak_epaths" | cut -d ' ' -f 1 | uniq`" if [ 'riak_kv_eleveldb_backend' = "$backend" ]; then - dr="`epath "riak_kv multi_backend $b riak_kv_eleveldb_backend data_root" "$riak_epaths" | + dr="`epath "$b riak_kv_eleveldb_backend data_root" "$riak_epaths" | sed -e 's/^\"//' -e 's/\".*$//'`" if [ '/' != `echo "$dr" | cut -c1` ]; then @@ -910,11 +940,11 @@ if [ 1 -eq $get_patches ]; then # As per the below link, this patch should be based off the base_dir. # http://docs.basho.com/riakee/latest/cookbooks/Rolling-Upgrade-to-Enterprise/#Basho-Patches - riak_lib_dir="${riak_base_dir}/lib/patches" # Use dump to execute the copy. This will provide a progress dot and # capture any error messages. - dump cp_patches cp -R "$riak_lib_dir"/* . + [ -r "${riak_lib_dir}/patches/*" ] && \ + dump cp_patches cp -R "${riak_lib_dir}/patches/*" . # If the copy succeeded, then the output will be empty and it is unneeded. if [ 0 -eq $? ]; then diff --git a/rel/files/riak-repl b/rel/files/riak-repl index 086482fc6..e9add02c7 100755 --- a/rel/files/riak-repl +++ b/rel/files/riak-repl @@ -5,7 +5,9 @@ # Identify the script name SCRIPT=`basename $0` -RPC_HOP="{{platform_bin_dir}}/riak rpc" +PLATFORM_BASE_DIR=${RCS_PATH:-$(cd $(dirname "$0")/.. && pwd -P)} + +RPC_HOP="${PLATFORM_BASE_DIR}/bin/riak rpc" V2REPLDEP="DEPRECATION NOTICE: The replication protocol you are currently using in this cluster has been deprecated and will be unsupported and removed some time after the Riak Enterprise 2.1 release. Please upgrade to the latest replication protocol as soon as possible. If you need assistance migrating contact Basho Client Services or follow the instructions in our documentation ( http://docs.basho.com/riakee/latest/cookbooks/Multi-Data-Center-Replication-UpgradeV2toV3/ )." diff --git a/rel/pkg/deb/vars.config b/rel/pkg/deb/vars.config index be3a7bc85..deb2a837b 100644 --- a/rel/pkg/deb/vars.config +++ b/rel/pkg/deb/vars.config @@ -1,7 +1,7 @@ %% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*- %% ex: ft=erlang ts=4 sw=4 et -{rel_vsn, "3.0.9.1"}. +{rel_vsn, "{{release_version}}"}. %% Platform-specific installation paths {platform_bin_dir, "/usr/lib/riak/bin"}. @@ -11,18 +11,10 @@ {platform_lib_dir, "/usr/lib/riak/lib"}. {platform_log_dir, "/var/log/riak"}. {platform_gen_dir, "/var/lib/riak"}. +{platform_patch_dir, "/usr/lib/riak/lib/patches"}. -{runner_script_dir, "/usr/lib/riak/bin"}. -{runner_base_dir, "/usr/lib/riak"}. -{runner_etc_dir, "/etc/riak"}. -{runner_log_dir, "/var/log/riak"}. -{runner_user, "riak"}. -{runner_lib_dir, "/usr/lib/riak/lib"}. -{runner_patch_dir, "/usr/lib/riak/lib/patches"}. {pipe_dir, "/tmp/riak"}. {pid_dir, "/run/riak"}. -{package_replacement_line, ""}. -{package_conflicts_line, ""}. {cluster_manager_ip, "127.0.0.1"}. {cluster_manager_port, 9080}. diff --git a/rel/pkg/rpm/vars.config b/rel/pkg/rpm/vars.config index f90cb32fc..90f05ca63 100644 --- a/rel/pkg/rpm/vars.config +++ b/rel/pkg/rpm/vars.config @@ -1,28 +1,20 @@ %% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*- %% ex: ft=erlang ts=4 sw=4 et -{rel_vsn, "3.0.9.1"}. +{rel_vsn, "{{release_version}}"}. %% Platform-specific installation paths -{platform_bin_dir, "/usr/lib64/riak/bin"}. -{platform_data_dir, "/var/lib/riak"}. -{platform_etc_dir, "/etc/riak"}. -{platform_base_dir, "/usr/lib64/riak"}. -{platform_lib_dir, "/usr/lib64/riak/lib"}. -{platform_log_dir, "/var/log/riak"}. -{platform_gen_dir, "/var/lib/riak"}. - -{runner_script_dir, "/usr/lib64/riak/bin"}. -{runner_base_dir, "/usr/lib64/riak"}. -{runner_etc_dir, "/etc/riak"}. -{runner_log_dir, "/var/log/riak"}. -{runner_user, "riak"}. -{runner_lib_dir, "/usr/lib64/riak/lib"}. -{runner_patch_dir, "/usr/lib64/riak/lib/patches"}. +{platform_bin_dir, "/usr/lib64/riak/bin"}. +{platform_data_dir, "/var/lib/riak"}. +{platform_etc_dir, "/etc/riak"}. +{platform_base_dir, "/usr/lib64/riak"}. +{platform_lib_dir, "/usr/lib64/riak/lib"}. +{platform_log_dir, "/var/log/riak"}. +{platform_gen_dir, "/var/lib/riak/releases"}. +{platform_patch_dir, "/usr/lib64/riak/lib/patches"}. + {pipe_dir, "/tmp/riak/"}. {pid_dir, "/var/run/riak"}. -{package_replacement_line, ""}. -{package_conflicts_line, ""}. {cluster_manager_ip, "127.0.0.1"}. {cluster_manager_port, 9080}. diff --git a/rel/vars.config b/rel/vars.config index 821593773..841e44d57 100644 --- a/rel/vars.config +++ b/rel/vars.config @@ -1,15 +1,17 @@ %% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*- %% ex: ft=erlang ts=4 sw=4 et -{rel_vsn, "3.0.9.1"}. +{rel_vsn, "{{release_version}}"}. %% Platform-specific installation paths -{platform_bin_dir, "./bin"}. -{platform_data_dir, "./data"}. -{platform_etc_dir, "./etc"}. -{platform_lib_dir, "./lib"}. -{platform_log_dir, "./log"}. -{platform_gen_dir, "./releases/{{rel_vsn}}"}. +{platform_base_dir, "${RIAK_PATH:-$RELEASE_ROOT_DIR}"}. +{platform_bin_dir, "./bin"}. +{platform_data_dir, "./data"}. +{platform_etc_dir, "./etc"}. +{platform_lib_dir, "./lib"}. +{platform_log_dir, "./log"}. +{platform_gen_dir, "."}. +{platform_patch_dir, "./lib/patches"}. %% %% etc/app.config @@ -39,16 +41,11 @@ %% %% bin/riak %% -{runner_script_dir, "{{platform_bin_dir}}"}. -{runner_base_dir, "{{platform_base_dir}}"}. -{runner_etc_dir, "{{platform_etc_dir}}"}. -{runner_log_dir, "{{platform_log_dir}}"}. -{runner_lib_dir, "{{platform_lib_dir}}"}. -{runner_patch_dir, "{{platform_lib_dir}}/patches"}. -{pipe_dir, "{{platform_base_dir}}/tmp/riak"}. -{pid_dir, "{{platform_base_dir}}/var/run/riak"}. -{runner_wait_process, "riak_core_node_watcher"}. -{runner_ulimit_warn, 65536}. + +%% relocatable releases don't call the launcher script, because +%% launcher script requires a riak user to exist. +%%{pipe_dir, "$PLATFORM_BASE_DIR/tmp/riak"}. +%%{pid_dir, "$PLATFORM_BASE_DIR/var/run/riak"}. %% %% cuttlefish diff --git a/rel/vars/dev_vars.config.src b/rel/vars/dev_vars.config.src index e5f33dec1..ee8ccb18a 100644 --- a/rel/vars/dev_vars.config.src +++ b/rel/vars/dev_vars.config.src @@ -1,18 +1,19 @@ %% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*- %% ex: ft=erlang ts=4 sw=4 et -{devrel, true}. +{rel_vsn, "{{release_version}}"}. -{rel_vsn, "3.0.9.1"}. +{devrel, true}. %% Platform-specific installation paths -{platform_base_dir, "@PLATFORM_BASE_DIR@"}. -{platform_bin_dir, "{{platform_base_dir}}/bin"}. -{platform_data_dir, "{{platform_base_dir}}/data"}. -{platform_etc_dir, "{{platform_base_dir}}/etc"}. -{platform_lib_dir, "{{platform_base_dir}}/lib"}. -{platform_log_dir, "{{platform_base_dir}}/log"}. -{platform_gen_dir, "{{platform_base_dir}}/releases/{{rel_vsn}}"}. +{platform_base_dir, "@PLATFORM_BASE_DIR@"}. +{platform_bin_dir, "{{platform_base_dir}}/bin"}. +{platform_data_dir, "{{platform_base_dir}}/data"}. +{platform_etc_dir, "{{platform_base_dir}}/etc"}. +{platform_lib_dir, "{{platform_base_dir}}/lib"}. +{platform_log_dir, "{{platform_base_dir}}/log"}. +{platform_gen_dir, "{{platform_base_dir}}"}. +{platform_patch_dir, "{{platform_lib_dir}}/patches"}. %% %% etc/app.config @@ -39,18 +40,6 @@ {node, "@NODE@"}. {crash_dump, "{{platform_log_dir}}/erl_crash.dump"}. -%% -%% bin/riak -%% -{runner_script_dir, "{{platform_bin_dir}}"}. -{runner_base_dir, "{{platform_base_dir}}"}. -{runner_etc_dir, "{{platform_etc_dir}}"}. -{runner_log_dir, "{{platform_log_dir}}"}. -{runner_lib_dir, "{{platform_lib_dir}}"}. -{runner_patch_dir, "{{platform_lib_dir}}/patches"}. -{pipe_dir, "{{platform_base_dir}}/tmp/riak"}. -{pid_dir, "{{platform_base_dir}}/var/run/riak"}. - %% %% cuttlefish %% diff --git a/rel/vars/perf_vars.config.src b/rel/vars/perf_vars.config.src index 51ad2bbda..01c8c7b06 100644 --- a/rel/vars/perf_vars.config.src +++ b/rel/vars/perf_vars.config.src @@ -2,11 +2,14 @@ %% ex: ft=erlang ts=4 sw=4 et %% Platform-specific installation paths -{platform_bin_dir, "./bin"}. -{platform_data_dir, "./data"}. -{platform_etc_dir, "./etc"}. -{platform_lib_dir, "./lib"}. -{platform_log_dir, "./log"}. +{platform_base_dir, "@PLATFORM_BASE_DIR@"}. +{platform_bin_dir, "{{platform_base_dir}}/bin"}. +{platform_data_dir, "{{platform_base_dir}}/data"}. +{platform_etc_dir, "{{platform_base_dir}}/etc"}. +{platform_lib_dir, "{{platform_base_dir}}/lib"}. +{platform_log_dir, "{{platform_base_dir}}/log"}. +{platform_gen_dir, "{{platform_base_dir}}"}. +{platform_patch_dir, "{{platform_lib_dir}}/patches"}. %% %% etc/app.config @@ -46,18 +49,6 @@ {node, "@NODE@"}. {crash_dump, "{{platform_log_dir}}/erl_crash.dump"}. -%% -%% bin/riak -%% -{runner_script_dir, "\`cd \\`dirname $0\\` && /bin/pwd\`"}. -{runner_base_dir, "{{runner_script_dir}}/.."}. -{runner_etc_dir, "$RUNNER_BASE_DIR/etc"}. -{runner_log_dir, "$RUNNER_BASE_DIR/log"}. -{runner_lib_dir, "$RUNNER_BASE_DIR/lib"}. -{runner_patch_dir, "$RUNNER_BASE_DIR/lib/basho-patches"}. -{pipe_dir, "/tmp/$RUNNER_BASE_DIR/"}. -{runner_user, ""}. -{runner_wait_process, "riak_core_node_watcher"}. %% %% cuttlefish @@ -68,6 +59,6 @@ %% %% yokozuna %% -{yz_dir, "{{platform_data_dir}}/yz"}. -{yz_solr_port, @YZSOLRPORT@}. -{yz_solr_jmx_port, @YZSOLRJMXPORT@}. +%{yz_dir, "{{platform_data_dir}}/yz"}. +%{yz_solr_port, @YZSOLRPORT@}. +%{yz_solr_jmx_port, @YZSOLRJMXPORT@}.