Modification : vm_{host,hosted,remote} -> {host,local,remote}/ .
[lhc/ateliers.git] / local / runit-sv-start
diff --git a/local/runit-sv-start b/local/runit-sv-start
new file mode 100755 (executable)
index 0000000..e4b8332
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh -eu
+# SYNTAX: $sv
+tool=$(readlink -e "${0%/*}/..")
+. "$tool"/local/lib.sh
+
+sv="$1"
+while true
+ do case $(sudo sv start "$sv" | tee /dev/stderr) in
+        (*": runsv not running") sleep 1;;
+        (*": unable to open supervise/ok: file does not exist") sleep 1;;
+        (*) break;;
+        esac
+ done