rustit/mirror_runit/runit-2.1.2/src/sv.check

28 lines
368 B
Text
Raw Normal View History

2024-03-25 00:51:57 +01:00
#!/bin/sh
rm -rf "${ctmp}"
trap 'rm -rf "${ctmp}"' EXIT
sv
echo $?
sv -V
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 $?