#!/bin/sh
rm -rf "${ctmp}"

svwaitdown
echo $?
svwaitdown -V
echo $?

mkdir "${ctmp}"
echo '#!/bin/sh' >"${ctmp}"/run
echo 'echo starting' >>"${ctmp}"/run
echo 'exec sleep 14' >>"${ctmp}"/run
chmod 700 "${ctmp}"/run
runsv "${ctmp}" &
sleep 1
test -r "${ctmp}"/supervise/stat || sleep 2
svwaitdown "${ctmp}"
echo $?
svwaitdown -x "${ctmp}"
echo $?
cat "${ctmp}"/supervise/stat
wait
echo $?
rm -rf "${ctmp}"
