Permalink
Browse files

better default handling in config (if dir is not defined, it's the ho…

…me dir); Lwt-2.3.2
  • Loading branch information...
1 parent 69c5eff commit 9bf812913ab2832faad3385dcca7df0cb4c5d385 toolslive committed Nov 24, 2011
Showing with 29 additions and 21 deletions.
  1. +2 −2 COMPILING
  2. +8 −10 cfg/arakoon.ini
  3. +8 −4 ctrl/nodes.ml
  4. +3 −3 debian/control
  5. +8 −2 src/node/node_cfg.ml
View
@@ -1,8 +1,8 @@
PREREQUISITES:
-ocaml 3.12
+ocaml 3.12.1
findlib 1.2.7
-lwt 2.3.0
+lwt 2.3.2
ounit 1.1.0
react 0.9.2
camlbz2 0.6.0
View
@@ -33,12 +33,12 @@ cluster_id = ricky
ip = 127.0.0.1
client_port = 4000
messaging_port = 4010
-home = /tmp/arakoon_0
+home = /tmp/arakoon/arakoon_0
#optional different directory for .tlog, .tlc and friends
-#tlog_dir = /tmp
-log_dir = /tmp/arakoon_0
+#tlog_dir = /tmp/arakoon/arakoon_0
+#log_dir = /tmp/arakoon/arakoon_0
# available levels are: debug info notice warning error fatal
-log_level = debug
+log_level = info
# for debugging
#laggy = true
# report every x seconds (default = 300)
@@ -48,19 +48,17 @@ log_level = debug
ip = 127.0.0.1
client_port = 4001
messaging_port = 4011
-home = /tmp/arakoon_1
-log_dir = /tmp/arakoon_1
-log_level = debug
+home = /tmp/arakoon/arakoon_1
+log_level = info
[arakoon_2]
name = arakoon_2
ip = 127.0.0.1
client_port = 4002
messaging_port = 4012
-home = /tmp/arakoon_2
-log_dir = /tmp/arakoon_2
-log_level = debug
+home = /tmp/arakoon/arakoon_2
+log_level = info
#[learner_0]
#ip = 127.0.0.1
View
@@ -5,6 +5,7 @@ module Node = struct
let names = ["arakoon_0";"arakoon_1";"arakoon_2"]
let cfg_name = (Unix.getcwd()) ^ "/cfg/arakoon.ini"
+ let root = "/tmp/arakoon"
let _node_cmd fmt name =
let cmd = Printf.sprintf fmt exec name cfg_name in
print_endline cmd;
@@ -22,8 +23,8 @@ module Node = struct
let monitor_all () =
let tab x = Printf.sprintf
- "--tab-with-profile=Default -e 'tail -f /tmp/%s/%s.log' -t '%s' "
- x x x
+ "--tab-with-profile=Default -e 'tail -f %s/%s/%s.log' -t '%s' "
+ root x x x
in
let tabs = List.map tab names in
let cmd = List.fold_left (^) "gnome-terminal " tabs in
@@ -32,11 +33,14 @@ module Node = struct
let mkdirs () =
let mkdir x =
- let dir_name = Printf.sprintf "/tmp/%s" x in
+ let dir_name = Printf.sprintf "%s/%s" root x in
Unix.mkdir dir_name 0o755
in List.map mkdir names
let clean_dirs () =
- List.iter (fun name -> ignore (Sys.command ("rm -rf /tmp/" ^ name))) names
+ let dir_name name = Printf.sprintf "%s/%s" root name in
+ List.iter
+ (fun name -> ignore (Sys.command ("rm -rf " ^ (dir_name name))))
+ names
end
View
@@ -2,8 +2,8 @@ Source: arakoon
Section: database
Priority: extra
Maintainer: Romain Slootmaekers <romain.slootmaekers@incubaid.com>
-Build-Depends: debhelper (>= 7), ocaml-nox (>= 3.11.1-3~), dh-ocaml (>= 0.9), ocaml-findlib (>= 1.2.5),
- liblwt-ocaml-dev (>= 2.1.1), libounit-ocaml-dev (>= 1.0.3), libbz2-ocaml-dev (>= 0.6.0),
+Build-Depends: debhelper (>= 7), ocaml-nox (>= 3.12.0), dh-ocaml (>= 0.9), ocaml-findlib (>= 1.2.5),
+ liblwt-ocaml-dev (>= 2.3.2), libounit-ocaml-dev (>= 1.0.3), libbz2-ocaml-dev (>= 0.6.0),
libbz2-dev (>= 1.0.5), texlive (>= 2009), texlive-font-utils (>= 2009), texlive-latex-base (>= 2009)
Standards-Version: 3.8.3
Homepage: http://www.arakoon.org
@@ -21,4 +21,4 @@ Architecture : any
Section: ocaml
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: ocaml client library for Arakoon
- Implementation of the Arakoon protocol
+ Implementation of the Arakoon protocol
View
@@ -210,7 +210,10 @@ module Node_cfg = struct
let client_port = get_int "client_port" in
let messaging_port = get_int "messaging_port" in
let home = get_string "home" in
- let tlog_dir = try get_string "tlog_dir" with _ -> home in
+ let tlog_dir =
+ try get_string "tlog_dir"
+ with _ -> home
+ in
let log_level = String.lowercase (get_string "log_level") in
let is_laggy = get_bool "laggy" in
let is_learner = get_bool "learner" in
@@ -221,7 +224,10 @@ module Node_cfg = struct
else []
in
let lease_period = _get_lease_period inifile in
- let log_dir = get_string "log_dir" in
+ let log_dir =
+ try get_string "log_dir"
+ with _ -> home
+ in
let reporting = Ini.get inifile node_name "reporting" Ini.p_int (Ini.default 300) in
{node_name;
ip;

0 comments on commit 9bf8129

Please sign in to comment.