                         | :xargs (c/lit "echo \"\" >> log/volt.log \\;")))
           (info node "rejoined")))
 
+(defn init-daemon!
+  "Starts the daemon with the given command."
+  [test cmd host]
+  (c/sudo username
+          (c/cd voltroot
+                (cu/start-daemon! {:logfile (str base-dir "/log/stdout.log")
+                                   :pidfile (str base-dir "/pidfile")
+                                   :chdir   base-dir}
+                                  (str base-dir "/bin/voltdb")
+                                  (str "init")
+                                  :--config (str base-dir "/deployment.xml")
+                                  :--force
+                                  :--dir (str base-dir) ))))
 (defn start-daemon!
   "Starts the daemon with the given command."
   [test cmd host]


(def username "voltdb")
(def base-dir "/opt/voltdb")

(defn os
  "Given OS, plus python & jdk8"

                                   :pidfile (str base-dir "/pidfile")
                                   :chdir   base-dir}
                                  (str base-dir "/bin/voltdb")
                                  (str "start")
                                  :--dir (str base-dir)
                                  :--count (count (:nodes test))
                                  :--host host))))

(defn start!
  "Starts voltdb, creating a fresh DB"
  [test node]
  (init-daemon! test :init (jepsen/primary test))
  (await-initialization node)
  (start-daemon! test :start (jepsen/primary test))
  (await-start node))

(defn recover!
  "Recovers an entire cluster, or with a node, a single node."
