rustit/mirror_runit/runit-2.1.2/src/sv.check
2024-03-24 23:51:57 +00:00

27 lines
368 B
Bash
Executable file

#!/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 $?