summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xpackaging/docker/catlfish-dev/start.sh13
1 files changed, 10 insertions, 3 deletions
diff --git a/packaging/docker/catlfish-dev/start.sh b/packaging/docker/catlfish-dev/start.sh
index b37c829..904ea10 100755
--- a/packaging/docker/catlfish-dev/start.sh
+++ b/packaging/docker/catlfish-dev/start.sh
@@ -1,11 +1,12 @@
#! /bin/sh
role=$1; [ -n "$1" ] && shift
-erlbase=$1; [ -n "$1" ] && shift
database=$1; [ -n "$1" ] && shift
+erlbase=$1; [ -n "$1" ] && shift
-[ -z "$erlbase" ] && erlbase=/usr/local/catlfish
+# Set sane defaults.
[ -z "$database" ] && database=/var/db/catlfish-merge
+[ -z "$erlbase" ] && erlbase=/usr/local/catlfish
case $role in
frontend|storage|signing)
@@ -15,11 +16,17 @@ case $role in
"exec $erlbase/bin/erl -config catlfish"
;;
merge)
- ERL_LIBS=$erlbase/lib/catlfish-0.6.0.ez/catlfish-0.6.0
+ # Catlfish version is included in filename of archive and
+ # filename in that archive. Example: lib/catlfish-0.6.0.ez
+ # contains catlfish-0.6.0.
+ ver=$(ls $erlbase/lib/catlfish-*.ez | sed 's/.*-\(.*\)\.ez/\1/1')
+ ERL_LIBS=$erlbase/lib/catlfish-${ver}.ez/catlfish-${ver}
ERL_LIBS=$ERL_LIBS:$erlbase/lib/lager-2.1.1.ez/lager-2.1.1
export ERL_LIBS
+
$erlbase/merge.sh 60 3600 $database > merge_log/stdout 2> merge_log/stderr
;;
*)
echo "catlfish: unknown role: $role"
+ ;;
esac