summary refs log tree commit diff
path: root/src/sv.check
diff options
context:
space:
mode:
authorGerrit Pape <pape@smarden.org>2005-07-23 13:12:39 +0000
committerGerrit Pape <pape@smarden.org>2005-07-23 13:12:39 +0000
commitd7f290365ad66a00913fb60a942b1e4075fc81c2 (patch)
treed840e9fb86227c766babe4a62286829058f5e017 /src/sv.check
parent8ef856eff7a3e73d7df7784aacbcd53c0e871b0e (diff)
downloadrunit-d7f290365ad66a00913fb60a942b1e4075fc81c2.tar.gz
runit-d7f290365ad66a00913fb60a942b1e4075fc81c2.tar.xz
runit-d7f290365ad66a00913fb60a942b1e4075fc81c2.zip
minimal sv.check.
Diffstat (limited to 'src/sv.check')
-rwxr-xr-xsrc/sv.check25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/sv.check b/src/sv.check
new file mode 100755
index 0000000..a778719
--- /dev/null
+++ b/src/sv.check
@@ -0,0 +1,25 @@
+#!/bin/sh
+rm -rf "${ctmp}"
+trap 'rm -rf "${ctmp}"' EXIT
+
+sv
+echo $?
+
+mkdir "${ctmp}"
+cat >"${ctmp}"/run <<-\EOT
+	#!/bin/sh
+	echo starting
+	exec sleep 14
+	EOT
+chmod 700 "${ctmp}"/run
+runsv "${ctmp}" &
+sleep 1
+test -r "${ctmp}"/supervise/stat || sleep 2
+sv down "${ctmp}"
+echo $?
+sleep 1
+cat "${ctmp}"/supervise/stat
+sv exit "${ctmp}"
+echo $?
+wait
+echo $?