summaryrefslogtreecommitdiff
path: root/catlfish-dev
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordu.net>2015-06-01 08:20:26 +0200
committerLinus Nordberg <linus@nordu.net>2015-06-01 08:20:26 +0200
commit6870d6ebe4ebc9f3bbe4e90c28259810d8b6dd3d (patch)
tree8bd76c5d3ae9a0ae1296258da0382f4b499a1a9e /catlfish-dev
parent75b66f346be07c4abbc9fd0b4effd83b8528042b (diff)
Don't rebuild config file if it exists.
Diffstat (limited to 'catlfish-dev')
-rwxr-xr-xcatlfish-dev/start.sh16
1 files changed, 12 insertions, 4 deletions
diff --git a/catlfish-dev/start.sh b/catlfish-dev/start.sh
index d673b9d..3a982fb 100755
--- a/catlfish-dev/start.sh
+++ b/catlfish-dev/start.sh
@@ -1,8 +1,11 @@
#! /bin/sh
+# Required arguments.
logname=$1; [ -n "$1" ] && shift
role=$1; [ -n "$1" ] && shift
nodename=$1; [ -n "$1" ] && shift
+
+# Optional arguments.
database=$CATLFISH_DB_DIR
erlbase=$ERLANG_BASE_DIR
@@ -10,20 +13,23 @@ erlbase=$ERLANG_BASE_DIR
[ -z "$database" ] && database=/var/db/catlfish-merge
[ -z "$erlbase" ] && erlbase=/usr/local/catlfish
-# We should probably grab this from the
+# FIXME: Get compileconfig.py from the
# $erlbase/lib/catlfish-$VERSION.ez (zip archive) instead of requiring
# source code to be unpacked in the container.
COMPILECONFIG=/usr/local/src/catlfish/tools/compileconfig.py
case $role in
frontend|storage|signing)
- $COMPILECONFIG --config ${logname}.cfg \
- --localconfig ${nodename}.cfg;
+ if ! [ -f ${nodename}.config ]; then
+ $COMPILECONFIG --config ${logname}.cfg \
+ --localconfig ${nodename}.cfg;
+ fi
$erlbase/bin/run_erl \
/var/run/catlfish/ \
/var/run/catlfish/erlang_log/ \
"exec $erlbase/bin/erl -config $nodename"
;;
+
merge)
# Catlfish version is included in filename of archive and
# filename in that archive. Example: lib/catlfish-0.6.0.ez
@@ -37,7 +43,9 @@ case $role in
export MERGE_INTERVAL_FREQ=3600
export MERGE_DB_DIR=$database
- $erlbase/merge.sh $logname $nodename > merge_log/stdout 2> merge_log/stderr
+ $erlbase/merge.sh $logname $nodename \
+ > merge_log/stdout \
+ 2> merge_log/stderr
;;
*)
echo "catlfish: unknown role: $role"