commit 9c2c6935a3558969f6980b069bc87252cc53a42b
parent f30af4150b9f9f991a1672b63ad9dd6cc7712b4c
Author: Gerrit Pape <pape@smarden.org>
Date: Sat, 23 Jul 2005 13:12:39 +0000
minimal sv.check.
Diffstat:
4 files changed, 35 insertions(+), 1 deletion(-)
diff --git a/src/Makefile b/src/Makefile
@@ -1,4 +1,4 @@
-IT=chpst runit runit-init runsv runsvchdir runsvctrl runsvdir runsvstat \
+IT=chpst runit runit-init runsv runsvchdir runsvctrl runsvdir runsvstat sv \
svlogd svwaitdown svwaitup utmpset
default: sysdeps $(IT)
diff --git a/src/TARGETS b/src/TARGETS
@@ -136,6 +136,7 @@ runsvchdir.local
runsvctrl.local
runsvdir.local
runsvstat.local
+sv.local
svlogd.local
svwaitdown.local
svwaitup.local
diff --git a/src/sv.check 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 $?
diff --git a/src/sv.dist b/src/sv.dist
@@ -0,0 +1,8 @@
+usage: sv [-v] [-w sec] action service ...
+
+100
+starting
+0
+down
+0
+0