Browse files

Updates for R15B

  • Loading branch information...
1 parent edc0528 commit f825d2613633921402a9190319747621682a4353 @norton norton committed Dec 20, 2011
View
124 Makefile
@@ -13,8 +13,29 @@ PLT=$(HOME)/.dialyzer_plt.$(OTPREL)
DIALYZE_IGNORE_WARN?=dialyze-ignore-warnings.txt
DIALYZE_NOSPEC_IGNORE_WARN?=dialyze-nospec-ignore-warnings.txt
-.PHONY: all test bootstrap-package check-package package generate compile eunit build-plt check-plt dialyze dialyze-spec dialyze-nospec dialyze-eunit dialyze-eunit-spec dialyze-eunit-nospec ctags etags clean realclean distclean
-
+ifeq ($(shell uname -s),Darwin)
+ ifeq ($(shell uname -m),x86_64)
+ otp_configure_flags= --enable-darwin-64bit
+ else
+ otp_configure_flags= --enable-darwin-universal
+ endif
+else
+ otp_configure_flags=
+endif
+
+.PHONY: all test \
+ compile compile-eqc compile-proper \
+ eunit-compile eqc-compile proper-compile \
+ eunit eqc proper \
+ doc \
+ build-plt check-plt \
+ dialyze dialyze-spec dialyze-nospec \
+ dialyze-eunit dialyze-eunit-spec dialyze-eunit-nospec \
+ dialyze-eqc dialyze-eqc-spec dialyze-eqc-nospec \
+ dialyze-proper dialyze-proper-spec dialyze-proper-nospec \
+ ctags etags \
+ clean realclean distclean \
+ bootstrap-package check-package package generate
all: compile
test: eunit
@@ -57,9 +78,39 @@ compile:
@echo "compiling: $(RELPKG) ..."
./rebar compile
-eunit: compile
+compile-eqc:
+ @echo "compiling-eqc: $(RELPKG) ..."
+ ./rebar compile -D QC -D QC_EQC
+
+compile-proper:
+ @echo "compiling-proper: $(RELPKG) ..."
+ ./rebar compile -D QC -D QC_PROPER
+
+eunit-compile: compile
+ @echo "eunit test compiling: $(RELPKG) ..."
+ ./rebar eunit-compile
+
+eqc-compile: compile-eqc
+ @echo "eqc test compiling: $(RELPKG) ..."
+ ./rebar eunit-compile -D QC -D QC_EQC
+
+proper-compile: compile-proper
+ @echo "proper test compiling: $(RELPKG) ..."
+ ./rebar eunit-compile -D QC -D QC_PROPER
+
+eunit: eunit-compile
@echo "eunit testing: $(RELPKG) ..."
- ./rebar eunit
+ ./rebar eunit skip_apps=meck
+
+eqc: eqc-compile
+ @echo "eqc testing: $(RELPKG) ... not implemented yet"
+
+proper: proper-compile
+ @echo "proper testing: $(RELPKG) ... not implemented yet"
+
+doc: compile
+ @echo "edoc generating: $(RELPKG) ..."
+ ./rebar doc
build-plt: $(PLT)
@@ -70,27 +121,48 @@ dialyze: dialyze-spec
dialyze-spec: build-plt clean compile
@echo "dialyzing w/spec: $(RELPKG) ..."
- find ./lib -wholename "*/meck/test/cover_test_module.beam" -exec rm {} \;
dialyzer --plt $(PLT) -Wunmatched_returns -r ./lib | fgrep -v -f $(DIALYZE_IGNORE_WARN)
dialyze-nospec: build-plt clean compile
@echo "dialyzing w/o spec: $(RELPKG) ..."
- find ./lib -wholename "*/meck/test/cover_test_module.beam" -exec rm {} \;
dialyzer --plt $(PLT) --no_spec -r ./lib | fgrep -v -f $(DIALYZE_NOSPEC_IGNORE_WARN)
dialyze-eunit: dialyze-eunit-spec
-dialyze-eunit-spec: build-plt clean compile
+dialyze-eunit-spec: build-plt clean eunit-compile
@echo "dialyzing .eunit w/spec: $(RELPKG) ..."
- ./rebar eunit-compile
#TODO dialyzer --plt $(PLT) -Wunmatched_returns -r `find ./lib -name .eunit -print | xargs echo` | fgrep -v -f $(DIALYZE_IGNORE_WARN)
dialyzer --plt $(PLT) -r `find ./lib -name .eunit -print | xargs echo` | fgrep -v -f $(DIALYZE_IGNORE_WARN)
-dialyze-eunit-nospec: build-plt clean compile
+dialyze-eunit-nospec: build-plt clean eunit-compile
@echo "dialyzing .eunit w/o spec: $(RELPKG) ..."
./rebar eunit-compile
dialyzer --plt $(PLT) --no_spec -r `find ./lib -name .eunit -print | xargs echo` | fgrep -v -f $(DIALYZE_NOSPEC_IGNORE_WARN)
+dialyze-eqc: dialyze-eqc-spec
+
+dialyze-eqc-spec: build-plt clean eqc-compile
+ @echo "dialyzing .eqc w/spec: $(RELPKG) ..."
+ #TODO dialyzer --plt $(PLT) -Wunmatched_returns -r `find ./lib -name .eunit -print | xargs echo` | fgrep -v -f $(DIALYZE_IGNORE_WARN)
+ dialyzer --plt $(PLT) -r `find ./lib -name .eunit -print | xargs echo` | fgrep -v -f $(DIALYZE_IGNORE_WARN)
+
+dialyze-eqc-nospec: build-plt clean eqc-compile
+ @echo "dialyzing .eqc w/o spec: $(RELPKG) ..."
+ ./rebar eqc-compile
+ dialyzer --plt $(PLT) --no_spec -r `find ./lib -name .eunit -print | xargs echo` | fgrep -v -f $(DIALYZE_NOSPEC_IGNORE_WARN)
+
+dialyze-proper: dialyze-proper-spec
+
+dialyze-proper-spec: build-plt clean proper-compile
+ @echo "dialyzing .proper w/spec: $(RELPKG) ..."
+ #TODO dialyzer --plt $(PLT) -Wunmatched_returns -r `find ./lib -name .eunit -print | xargs echo` | fgrep -v -f $(DIALYZE_IGNORE_WARN)
+ dialyzer --plt $(PLT) -r `find ./lib -name .eunit -print | xargs echo` | fgrep -v -f $(DIALYZE_IGNORE_WARN)
+
+dialyze-proper-nospec: build-plt clean proper-compile
+ @echo "dialyzing .proper w/o spec: $(RELPKG) ..."
+ ./rebar proper-compile
+ dialyzer --plt $(PLT) --no_spec -r `find ./lib -name .eunit -print | xargs echo` | fgrep -v -f $(DIALYZE_NOSPEC_IGNORE_WARN)
+
ctags:
find ./lib -name "*.[he]rl" -print | fgrep -v .eunit | ctags -
find ./lib -name "*.app.src" -print | fgrep -v .eunit | ctags -a -
@@ -142,3 +214,37 @@ $(PLT):
tools \
webtool \
xmerl
+
+otp: otp.git
+ make -C otp.git install
+
+otp.git:
+ rm -rf $(CURDIR)/otp
+ mkdir -p $(CURDIR)/otp
+ git clone git://github.com/erlang/otp.git otp.git
+ (cd otp.git && \
+ git co OTP_R15B && \
+ ./otp_build autoconf && \
+ ./configure \
+ --disable-hipe \
+ --enable-debug \
+ --enable-kernel-poll \
+ --enable-threads \
+ --enable-dynamic-ssl-lib \
+ --enable-shared-zlib \
+ --enable-smp-support \
+ $(otp_configure_flags) \
+ --prefix=$(CURDIR)/otp)
+ make -C otp.git
+
+otp-debug: otp.git
+ env ERL_TOP=$(PWD)/otp.git make -C ./otp.git/erts/emulator debug FLAVOR=smp
+
+otp-valgrind: otp.git
+ env ERL_TOP=$(PWD)/otp.git make -C ./otp.git/erts/emulator valgrind FLAVOR=smp
+
+cerl-debug: otp.git
+ env ERL_TOP=$(PWD)/otp.git ./otp.git/bin/cerl -debug
+
+cerl-valgrind: otp.git
+ env ERL_TOP=$(PWD)/otp.git ./otp.git/bin/cerl -valgrind
View
5 dialyze-ignore-warnings.txt
@@ -14,9 +14,12 @@ leexinc.hrl:243: The pattern <Rest, Line, {'token', _T, Push}, Error> can never
leexinc.hrl:248: The pattern <Rest, Line, {'end_token', _T, Push}, Error> can never match the type <_,_,'error' | 'skip_token',_>
leexinc.hrl:253: The pattern <Rest, Line, {'skip_token', Push}, Error> can never match the type <_,_,'error',_>
leexinc.hrl:256: The pattern <Rest, Line, {'error', _S}, Error> can never match the type <_,_,'error',_>
-yeccpre.hrl:49: Function return_error/2 will never be called
brick_chainmon.erl:1096: The created fun has no local return
brick_ets.erl:3053: The created fun has no local return
brick_mboxmon.erl:313: The created fun has no local return
brick_server.erl:4995: The created fun has no local return
+meck.erl:644: The pattern <Mod, Func, Args, [Meck = {'meck', 'exec', _Arity} | Stack]> can never match the type <atom(),_,_,[{atom(),atom(),[any()] | byte(),[any()]},...]>
+partition_detector_sup.erl:32: The return type {'ok',_} in the specification of init/1 is not a subtype of 'ignore' | {'ok',{{'one_for_all',non_neg_integer(),non_neg_integer()} | {'one_for_one',non_neg_integer(),non_neg_integer()} | {'rest_for_one',non_neg_integer(),non_neg_integer()} | {'simple_one_for_one',non_neg_integer(),non_neg_integer()},[{_,{atom() | tuple(),atom(),'undefined' | [any()]},'permanent' | 'temporary' | 'transient','brutal_kill' | 'infinity' | non_neg_integer(),'supervisor' | 'worker','dynamic' | [atom() | tuple()]}]}}, which is the expected return type for the callback of supervisor behaviour
riak_err_handler.erl:161: Expression produces a value of type 'ok' | {'error',atom()}, but this value is unmatched
+riak_err_monitor.erl:84: The specified type for the 2nd argument of handle_call/3 (reference()) is not a supertype of {pid(),_}, which is expected type for this argument in the callback of the gen_server behaviour
+riak_err_sup.erl:39: The return type {'ok',{{'one_for_one',1000,3600},[tuple()]}} in the specification of init/1 is not a subtype of 'ignore' | {'ok',{{'one_for_all',non_neg_integer(),non_neg_integer()} | {'one_for_one',non_neg_integer(),non_neg_integer()} | {'rest_for_one',non_neg_integer(),non_neg_integer()} | {'simple_one_for_one',non_neg_integer(),non_neg_integer()},[{_,{atom() | tuple(),atom(),'undefined' | [any()]},'permanent' | 'temporary' | 'transient','brutal_kill' | 'infinity' | non_neg_integer(),'supervisor' | 'worker','dynamic' | [atom() | tuple()]}]}}, which is the expected return type for the callback of supervisor behaviour
View
27 dialyze-nospec-ignore-warnings.txt
@@ -14,17 +14,26 @@ leexinc.hrl:243: The pattern <Rest, Line, {'token', _T, Push}, Error> can never
leexinc.hrl:248: The pattern <Rest, Line, {'end_token', _T, Push}, Error> can never match the type <_,_,'error' | 'skip_token',_>
leexinc.hrl:253: The pattern <Rest, Line, {'skip_token', Push}, Error> can never match the type <_,_,'error',_>
leexinc.hrl:256: The pattern <Rest, Line, {'error', _S}, Error> can never match the type <_,_,'error',_>
-yeccpre.hrl:49: Function return_error/2 will never be called
-brick_admin.erl:1315: Function bootstrap_scan_loop/0 has no local return
-brick_admin.erl:1327: Function bootstrap_scan_loop2/0 has no local return
brick_chainmon.erl:1096: The created fun has no local return
brick_ets.erl:3053: The created fun has no local return
-brick_itimer.erl:213: Function start_interval_loop/1 has no local return
-brick_itimer.erl:219: Function interval_loop/1 has no local return
brick_mboxmon.erl:313: The created fun has no local return
brick_mboxmon.erl:329: Function start_water_report_loop/3 has no local return
brick_server.erl:4995: The created fun has no local return
-ebf.erl:21: Function encode/1 has no local return
-ebf.erl:32: Function decode/1 has no local return
-ebf.erl:36: Function decode/2 has no local return
-meck.erl:450: Function invalidate_and_raise/5 has no local return
+ebf.erl:29: Callback info about the contract_proto behaviour is not available
+ebf.erl:44: Function encode/1 has no local return
+ebf.erl:55: Function decode/1 has no local return
+ebf.erl:59: Function decode/2 has no local return
+ebf.erl:68: Function decode_init/0 has no local return
+ebf.erl:72: Function decode_init/1 has no local return
+ebf_driver.erl:34: Callback info about the contract_driver behaviour is not available
+ftbf.erl:3: Callback info about the contract_proto behaviour is not available
+ftbf_driver.erl:5: Callback info about the contract_driver behaviour is not available
+jsf.erl:118: Callback info about the contract_proto behaviour is not available
+jsf_driver.erl:5: Callback info about the contract_driver behaviour is not available
+meck.erl:621: Function invalidate_and_raise/6 has no local return
+meck.erl:644: The pattern <Mod, Func, Args, [Meck = {'meck', 'exec', _Arity} | Stack]> can never match the type <atom(),_,_,[{atom(),atom(),[any()] | byte(),[any()]},...]>
+tbf.erl:257: Callback info about the contract_proto behaviour is not available
+tbf_driver.erl:5: Callback info about the contract_driver behaviour is not available
+ubf.erl:40: Callback info about the contract_proto behaviour is not available
+ubf_driver.erl:27: Callback info about the contract_driver behaviour is not available
+ubf_thrift_plugin.erl:7: Callback info about the ubf_plugin_stateless behaviour is not available
View
BIN rebar
Binary file not shown.
View
37 rebar.config
@@ -1,31 +1,10 @@
%%% -*- mode: erlang -*-
-%% Additional library directories to add to the code path
-{lib_dirs, ["./lib"]}.
-
-%% Require OTP version R13B04 or R14
-{require_otp_vsn, "R13B04|R14"}.
+%% Require OTP version R13B04, R14, or R15
+{require_otp_vsn, "R13B04|R14|R15"}.
%% Sub directories
-{sub_dirs, ["lib/gmt_util"
- , "lib/riak_err"
- , "lib/cluster_info"
- , "lib/partition_detector"
- , "lib/congestion_watcher"
- , "lib/meck"
- , "lib/mochiweb"
- , "lib/s3"
- , "lib/ubf"
- , "lib/ubf_jsonrpc"
- , "lib/ubf_thrift"
- , "lib/gdss_brick"
- , "lib/gdss_client"
- , "lib/gdss_admin"
- , "lib/gdss_ubf_proto"
- , "lib/gdss_json_rpc_proto"
- , "lib/gdss_s3_proto"
- , "rel"
- ]}.
+{sub_dirs, ["rel"]}.
%% Depends
{deps_dir, "lib"}.
@@ -35,11 +14,13 @@
, {partition_detector, "0.1.2", "lib/partition_detector"}
, {congestion_watcher, "0.1.1", "lib/congestion_watcher"}
, {meck, "0.7.1", "lib/meck"}
- , {mochiweb, "2.0.0", "lib/mochiweb"}
+ , {edown, "0.2.9", "lib/edown"}
+ , {asciiedoc, "0.1.2", "lib/asciiedoc"}
+ , {mochiweb, "2.3.1", "lib/mochiweb"}
, {s3, "0.1.1", "lib/s3"}
- , {ubf, "1.15.6", "lib/ubf"}
- , {ubf_jsonrpc, "0.1.2", "lib/ubf_jsonrpc"}
- , {ubf_thrift, "0.1.2", "lib/ubf_thrift"}
+ , {ubf, "1.15.10", "lib/ubf"}
+ , {ubf_jsonrpc, "0.1.6", "lib/ubf_jsonrpc"}
+ , {ubf_thrift, "0.1.6", "lib/ubf_thrift"}
, {gdss_brick, "0.1.6", "lib/gdss_brick"}
, {gdss_client, "0.1.6", "lib/gdss_client"}
, {gdss_admin, "0.1.5", "lib/gdss_admin"}
View
35 rel/files/hibari
@@ -21,29 +21,42 @@ cd $RUNNER_BASE_DIR
# Make sure log directory exists
mkdir -p $RUNNER_LOG_DIR
+# Identify the script name
+SCRIPT=`basename $0`
+
+# Parse out release and erts info
+START_ERL=`cat $RUNNER_BASE_DIR/releases/start_erl.data`
+ERTS_VSN=${START_ERL% *}
+APP_VSN=${START_ERL#* }
+
+# Use releases/VSN/vm.args if it exists otherwise use etc/vm.args
+if [ -e "$RUNNER_BASE_DIR/releases/$APP_VSN/vm.args" ]; then
+ VMARGS_PATH="$RUNNER_BASE_DIR/releases/$APP_VSN/vm.args"
+else
+ VMARGS_PATH="$RUNNER_ETC_DIR/vm.args"
+fi
+
+# Use releases/VSN/sys.config if it exists otherwise use etc/app.config
+if [ -e "$RUNNER_BASE_DIR/releases/$APP_VSN/sys.config" ]; then
+ CONFIG_PATH="$RUNNER_BASE_DIR/releases/$APP_VSN/sys.config"
+else
+ CONFIG_PATH="$RUNNER_ETC_DIR/app.config"
+fi
# Extract the target node name from node.args
-NAME_ARG=`egrep '^-s?name' $RUNNER_ETC_DIR/vm.args`
+NAME_ARG=`egrep '^-s?name' $VMARGS_PATH`
if [ -z "$NAME_ARG" ]; then
echo "vm.args needs to have either -name or -sname parameter."
exit 1
fi
# Extract the target cookie
-COOKIE_ARG=`grep '^-setcookie' $RUNNER_ETC_DIR/vm.args`
+COOKIE_ARG=`grep '^-setcookie' $VMARGS_PATH`
if [ -z "$COOKIE_ARG" ]; then
echo "vm.args needs to have a -setcookie parameter."
exit 1
fi
-# Identify the script name
-SCRIPT=`basename $0`
-
-# Parse out release and erts info
-START_ERL=`cat $RUNNER_BASE_DIR/releases/start_erl.data`
-ERTS_VSN=${START_ERL% *}
-APP_VSN=${START_ERL#* }
-
# Add ERTS bin dir to our path
ERTS_PATH=$RUNNER_BASE_DIR/erts-$ERTS_VSN/bin
@@ -165,7 +178,7 @@ case "$1" in
BINDIR=$ROOTDIR/erts-$ERTS_VSN/bin
EMU=beam
PROGNAME=`echo $0 | sed 's/.*\\///'`
- CMD="$BINDIR/erlexec -boot $RUNNER_BASE_DIR/releases/$APP_VSN/$BOOTFILE -mode embedded -config $RUNNER_ETC_DIR/app.config -args_file $RUNNER_ETC_DIR/vm.args -- ${1+"$@"}"
+ CMD="$BINDIR/erlexec -boot $RUNNER_BASE_DIR/releases/$APP_VSN/$BOOTFILE -mode embedded -config $CONFIG_PATH -args_file $VMARGS_PATH -- ${1+"$@"}"
export EMU
export ROOTDIR
export BINDIR
View
33 rel/files/hibari-admin
@@ -21,29 +21,42 @@ cd $RUNNER_BASE_DIR
# Make sure log directory exists
mkdir -p $RUNNER_LOG_DIR
+# Identify the script name
+SCRIPT=`basename $0`
+
+# Parse out release and erts info
+START_ERL=`cat $RUNNER_BASE_DIR/releases/start_erl.data`
+ERTS_VSN=${START_ERL% *}
+APP_VSN=${START_ERL#* }
+
+# Use releases/VSN/vm.args if it exists otherwise use etc/vm.args
+if [ -e "$RUNNER_BASE_DIR/releases/$APP_VSN/vm.args" ]; then
+ VMARGS_PATH="$RUNNER_BASE_DIR/releases/$APP_VSN/vm.args"
+else
+ VMARGS_PATH="$RUNNER_ETC_DIR/vm.args"
+fi
+
+# Use releases/VSN/sys.config if it exists otherwise use etc/app.config
+if [ -e "$RUNNER_BASE_DIR/releases/$APP_VSN/sys.config" ]; then
+ CONFIG_PATH="$RUNNER_BASE_DIR/releases/$APP_VSN/sys.config"
+else
+ CONFIG_PATH="$RUNNER_ETC_DIR/app.config"
+fi
# Extract the target node name from node.args
-NAME_ARG=`egrep '^-s?name' $RUNNER_ETC_DIR/vm.args`
+NAME_ARG=`egrep '^-s?name' $VMARGS_PATH`
if [ -z "$NAME_ARG" ]; then
echo "vm.args needs to have either -name or -sname parameter."
exit 1
fi
# Extract the target cookie
-COOKIE_ARG=`grep '^-setcookie' $RUNNER_ETC_DIR/vm.args`
+COOKIE_ARG=`grep '^-setcookie' $VMARGS_PATH`
if [ -z "$COOKIE_ARG" ]; then
echo "vm.args needs to have a -setcookie parameter."
exit 1
fi
-# Identify the script name
-SCRIPT=`basename $0`
-
-# Parse out release and erts info
-START_ERL=`cat $RUNNER_BASE_DIR/releases/start_erl.data`
-ERTS_VSN=${START_ERL% *}
-APP_VSN=${START_ERL#* }
-
# Add ERTS bin dir to our path
ERTS_PATH=$RUNNER_BASE_DIR/erts-$ERTS_VSN/bin
View
56 rel/files/hibari-admin.cmd
@@ -0,0 +1,56 @@
+@setlocal
+
+@set node_name=hibari
+
+@rem Get the abolute path to the parent directory,
+@rem which is assumed to be the node root.
+@for /F "delims=" %%I in ("%~dp0..") do @set node_root=%%~fI
+
+@set releases_dir=%node_root%\releases
+
+@rem Parse ERTS version and release version from start_erl.data
+@for /F "tokens=1,2" %%I in (%releases_dir%\start_erl.data) do @(
+ @call :set_trim erts_version %%I
+ @call :set_trim release_version %%J
+)
+
+@set erts_bin=%node_root%\erts-%erts_version%\bin
+
+@set service_name=%node_name%_%release_version%
+
+@if "%1"=="install" @goto install
+@if "%1"=="uninstall" @goto uninstall
+@if "%1"=="start" @goto start
+@if "%1"=="stop" @goto stop
+@if "%1"=="restart" @call :stop && @goto start
+@if "%1"=="console" @goto console
+@rem TODO: attach, ping, restart and reboot
+
+:usage
+@echo Usage: %0 {install|uninstall|start|stop|restart|console}
+@goto :EOF
+
+:install
+@%erts_bin%\erlsrv.exe add %service_name% -c "Erlang node %node_name% in %node_root%" -w %node_root% -m %node_root%\bin\start_erl.cmd -args " ++ %node_name% ++ %node_root%" -stopaction "init:stop()."
+@goto :EOF
+
+:uninstall
+@%erts_bin%\erlsrv.exe remove %service_name%
+@%erts_bin%\epmd.exe -kill
+@goto :EOF
+
+:start
+@%erts_bin%\erlsrv.exe start %service_name%
+@goto :EOF
+
+:stop
+@%erts_bin%\erlsrv.exe stop %service_name%
+@goto :EOF
+
+:console
+@start %erts_bin%\werl.exe -boot %releases_dir%\%release_version%\%node_name%
+@goto :EOF
+
+:set_trim
+@set %1=%2
+@goto :EOF
View
56 rel/files/hibari.cmd
@@ -0,0 +1,56 @@
+@setlocal
+
+@set node_name=hibari
+
+@rem Get the abolute path to the parent directory,
+@rem which is assumed to be the node root.
+@for /F "delims=" %%I in ("%~dp0..") do @set node_root=%%~fI
+
+@set releases_dir=%node_root%\releases
+
+@rem Parse ERTS version and release version from start_erl.data
+@for /F "tokens=1,2" %%I in (%releases_dir%\start_erl.data) do @(
+ @call :set_trim erts_version %%I
+ @call :set_trim release_version %%J
+)
+
+@set erts_bin=%node_root%\erts-%erts_version%\bin
+
+@set service_name=%node_name%_%release_version%
+
+@if "%1"=="install" @goto install
+@if "%1"=="uninstall" @goto uninstall
+@if "%1"=="start" @goto start
+@if "%1"=="stop" @goto stop
+@if "%1"=="restart" @call :stop && @goto start
+@if "%1"=="console" @goto console
+@rem TODO: attach, ping, restart and reboot
+
+:usage
+@echo Usage: %0 {install|uninstall|start|stop|restart|console}
+@goto :EOF
+
+:install
+@%erts_bin%\erlsrv.exe add %service_name% -c "Erlang node %node_name% in %node_root%" -w %node_root% -m %node_root%\bin\start_erl.cmd -args " ++ %node_name% ++ %node_root%" -stopaction "init:stop()."
+@goto :EOF
+
+:uninstall
+@%erts_bin%\erlsrv.exe remove %service_name%
+@%erts_bin%\epmd.exe -kill
+@goto :EOF
+
+:start
+@%erts_bin%\erlsrv.exe start %service_name%
+@goto :EOF
+
+:stop
+@%erts_bin%\erlsrv.exe stop %service_name%
+@goto :EOF
+
+:console
+@start %erts_bin%\werl.exe -boot %releases_dir%\%release_version%\%node_name%
+@goto :EOF
+
+:set_trim
+@set %1=%2
+@goto :EOF
View
39 rel/files/start_erl.cmd
@@ -0,0 +1,39 @@
+@setlocal
+
+@rem Parse arguments. erlsrv.exe prepends erl arguments prior to first ++.
+@rem Other args are position dependent.
+@set args="%*"
+@for /F "delims=++ tokens=1,2,3" %%I in (%args%) do @(
+ @set erl_args=%%I
+ @call :set_trim node_name %%J
+ @call :set_trim node_root %%K
+)
+
+@set releases_dir=%node_root%\releases
+
+@rem parse ERTS version and release version from start_erl.dat
+@for /F "tokens=1,2" %%I in (%releases_dir%\start_erl.data) do @(
+ @call :set_trim erts_version %%I
+ @call :set_trim release_version %%J
+)
+
+@set erl_exe=%node_root%\erts-%erts_version%\bin\erl.exe
+@set boot_file=%releases_dir%\%release_version%\%node_name%
+
+@if exist %releases_dir%\%release_version%\sys.config (
+ @set app_config=%releases_dir%\%release_version%\sys.config
+) else (
+ @set app_config=%node_root%\etc\app.config
+)
+
+@if exist %releases_dir%\%release_version%\vm.args (
+ @set vm_args=%releases_dir%\%release_version%\vm.args
+) else (
+ @set vm_args=%node_root%\etc\vm.args
+)
+
+@%erl_exe% %erl_args% -boot %boot_file% -config %app_config% -args_file %vm_args%
+
+:set_trim
+@set %1=%2
+@goto :EOF
View
0 rel/files/app.config → rel/files/sys.config
File renamed without changes.
View
1 rel/files/vm.args
@@ -1,4 +1,3 @@
-
## Name of the node
-name hibari@127.0.0.1
View
12 rel/reltool.config
@@ -57,7 +57,11 @@
{app, gdss_s3_proto, [{incl_cond, include}]},
{app, gdss_ubf_proto, [{incl_cond, include}]},
{app, gdss_json_rpc_proto, [{incl_cond, include}]},
- {app, gdss_admin, [{incl_cond, include}]}
+ {app, gdss_admin, [{incl_cond, include}]},
+ %% Including HiPE can cause issues generating your first upgrade.
+ %% If you plan to distribute HiPE in your release remove the
+ %% following line.
+ {app, hipe, [{incl_cond, exclude}]}
]}.
{target_dir, "hibari"}.
@@ -72,13 +76,15 @@
{copy, "files/nodetool-admin", "{{erts_vsn}}/bin/nodetool-admin"},
%% bin/
+ {copy, "files/hibari.cmd", "bin/hibari.cmd"},
+ {copy, "files/start_erl.cmd", "bin/start_erl.cmd"},
{template, "files/hibari", "bin/hibari"},
{template, "files/hibari-admin", "bin/hibari-admin"},
%% etc/
{copy, "files/congestion_watcher.config", "etc/congestion_watcher.config"},
- {template, "files/app.config", "etc/app.config"},
- {template, "files/vm.args", "etc/vm.args"},
+ {template, "files/sys.config", "releases/\{\{rel_vsn\}\}/sys.config"},
+ {template, "files/vm.args", "releases/\{\{rel_vsn\}\}/vm.args"},
%% relnotes/
{mkdir, "relnotes"},

0 comments on commit f825d26

Please sign in to comment.